Some of our more common models are shared throughout our app ecosystem
and we frequently run into a problem with get_absolute_url/permalink/
etc of generating required URLs, in particular looking at user A's
interaction with a model vs user B's that may occur in a completely
separate part of the
I have the following models:
class User(models.Model):
pass
class Item(Models.Mode):
created = models.DateTime(default=datetime.now)
user = models.ForeignKey(User, related_name="items")
class Meta:
ordering = ("-created",)
get_latest_by = "created"
So a user
Under settings.DEBUG=True, django.db.connection.queries is an array of
all queries executed. Obviously storing every query in text is a
memory hog. Would it still thrash as much if I wrote my own wrapper
around a DB connection class via settings.DATABASE_ENGINE that
implemented its own
{{ post.subject|slice:":15"|escape }} does the job.
On Aug 20, 6:55 am, patrickk <[EMAIL PROTECTED]> wrote:
> thanks.
>
> since truncatewords and truncatewords_html are predefined filters, I
> guess that truncate should also be one (just my opinion).
>
> patrick
>
> On 20 Aug., 12:33, Malcolm
I'm serving rather large, static files through Django. I'd rather not
use renaming trickery to serve them, but I don't know what the best
way to serve them through HttpResponse is. I used to use this:
response = HttpResponse(iter(open(file_path, "rb")))
return response
in my view. That stopped
5 and is in my path (from the CMD
> i can start pyton any where)
>
> any other suggestions?
>
> thanks again for helping
>
> oli
>
> On May 10, 3:12 pm, Ceph <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > Go to Edit > Preferences. Expand the &qu
Hello,
Go to Edit > Preferences. Expand the "Languages" group by clicking the
[+] symbol. Click "Python". Click the little "Add..." button under
"Additional Python Import Directories". Add the directory ABOVE your
project and you should have intellisense enabled.
On May 9, 12:01 pm, oliver
Would it be possible to allow custom error messages per field in
newforms?
E.g.,
class MyForm(forms.Form):
username = forms.CharField(label="User Name", error="Please enter
your user name.")
"This field is required." doesn't work well if you are displaying your
errors on top of your form
I'm toying around with converting my forms over to newforms and have
come across a problem which may be just user error.
I have a form:
class AddForm(Form):
flags = MultipleChoiceField(choices=[("A", "Aquatic"), ("C",
"Canopy")])
I have a view, which for the moment, is just trying to
I've run into a problem trying to use template tags in a child template
where the tag tries to fill block content in the child template or the
parent template. This is how it is set up:
base.html:
{% block nav %}{% endblock %}
child.html
{% extends "base.html" %}
{% load navigation %}
{%
Do you have any sort of Google Toolbar or any addons (or Firefox
itself) that are set to remember form field information? The reason the
Django (admin, presumably?) code will highlight is based on field
names, so if your text field ends up with name="email", the toolbar
will recognize it. In
ationships using related_names, but
I'm not positive.
Are there any documents out there that outline more than simple
relationship cases?
~Ceph
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users&
I seem to recall some documentation somewhere, but it appears I was
hallucinating because I can't find it again.
Is there a way to add custom field in a Django ManyToMany
relationship? Example has two models, Article and Category. An Article
has a ManyToMany relationship to Categories. However,
13 matches
Mail list logo