Todd,
I recommend that you have a look at Coffin:
http://github.com/dcramer/coffin
It comes with a {% url %} that should work out of the box.
The snippets you linked are not tags, but functions, that is, you
would do something like:
{{ url('my_view') }}
You need the pass the functions in
I'm working on a Universal Feed Parser-based library to create
aggregators. The idea is that the process of parsing a feed and syncing
it's items with a database can be customized by various addins:
http://github.com/miracle2k/feedplatform
It mostly works already, though it lacks the polishing
I'd probably put it in my models file.
Michael
Thomas Guettler schrieb:
> Hi,
>
> our customer wants to display the username as 'username: firstname
> lastname'
>
> The easiest way would be to overwrite User.__unicode__. But where
> should you put code like this? Up to now I put it in our mid
> but the page seems to load forever and I'm stuck!
I'm pretty sure I ran into this before, and IIRC it's because Django's
runserver, which I assume you are using, can only handle one request at
a time - try a different test url.
Michael
MariusB schrieb:
> I'm trying to take a link as an arg
>> There is 'post_save' signal with 'created' parameter. But,
>> unfortunately, this feature is undocumented...
>
> It's something related with "dispatcher" class? Please let me know if
> there is more about signals than the code below. I simply just use
> this;
If you use post_save instead
> def save(self): if self.pk: ...=> being created else: ...=> being
> updated
>
> I vaguely remember seeing a parameter for the save method which would
> do that, but I can't find it. Any thoughts?
That's the correct way to do it, unless you want to use signals:
http://www.martin-geber.com
> There's no other way to set it?
Just set the labels *before* calling super().
Michael
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googl
> I'd like to override the save() method and within it I'd like to test
> if a value has changed, that is, if that value as stored in the
> object (in memory) is different from what is actually stored in
> database.
Another approach is using __getattr__ to monitor changes. It saves you a
qu
> gallery application, and I have several uses who can post their
> galleries to this application. Is there a way to create permission on
> a per-user basis.
There apparently was some work on a per-object permissions branch in the
past, but it looks pretty dead:
http://code.djangoproject.co
> I'm sure I'm not the only person who has come across
> this problem
I ran into this yesterday:
http://code.djangoproject.com/ticket/6533
Might be related?
Michael
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Grou
> subtasks = tasks.exclude(part_of__exact='None')
> returns the correct subset, with the "top" tasks omitted. Why?
'None' is a string, so if anything, you'd have to use: part_of__exact=None
However, what you're looking for is probably:
subtasks = Task.objects.filter(part_of__isnull=True)
Mic
> How can I create passwords protected feeds with Django? I guess I
> will have to go beyond the contrib.feeds framework, but if some one
> has any recipes/links to how to do this, it would be most helpful!
Use your own custom view to render the feed, and just wrap HTTP auth
around it. There
On Apr 23, 10:29 pm, Jay <[EMAIL PROTECTED]> wrote:
> In the django docs I see that you can easily make a foreign key by
> referencing the model:
>
> manufacturer = models.ForeignKey('production.Manufacturer')
>
> ...but it feels like maybe stepping outside the "django way."
You can also just i
> So I guess I'm just curious to hear how other members of the
> community have solved this. Are people slipping business logic into
> the model classes for the most part?
If what I need to write doesn't really fit in any of the common
"places" (models, managers, views, middleware etc.), then I
> form.category.queryset =
> Category.objects.filter(blog__exact=request.user.author_set.all()
> [0].blog) print form.category.queryset
I am somewhat surprised that this would work at all. The field objects
should be accessible via
FormClass.base_fields['fieldname']
or
form_instance.fields['fi
I just updated to an auto-escaping enabled trunk, and I'm trying to
adjust some template tags. One of them stores a nodelist and renders
it at some point.
Now, NodeList.render() returns escaped data, but does not mark it as
safe (it's a unicode instance). Is this just an oversight, or as
designed
> It's an oversight; I hadn't thought of that case. You're right, marking
> render() output as safe should be the right thing to do. If you'd care
> to open a ticket so this doesn't get lost, I'll fix it tomorrow or
> during the sprint on the weekend.
Thanks Malcolm:
http://code.djangoproject.co
I just spent the last 5 hours debugging this, what a nightmare ;)
I recently updated from around rev. ~5600 to the latest trunk. Before
the update, I was doing this:
# wrap render method
MyFormClass.base_fields['fieldname'].widget.render =
new.instancemethod()
...
myform = MyFormClass()
..
> class Description(ChangeImplementor, models.Model):
I might have a flaw in my logic, but if you were to switch the bases,
inherit from models.Model first, and implemented a save() in
ChangeImplementor, models.Model.save() should be called first, create
the row, and by the time ChangeImpleme
Andrew schrieb:
> That's a good thought, but unfortunately that's not the way multiple
> inheritance works... only the first method in the chain gets called.
>
> On Dec 15, 6:54 am, Michael Elsdörfer <[EMAIL PROTECTED]>
> wrote:
>>> class Description(ChangeImple
Rob Hudson schrieb:
> If I understand correctly, these cache the templates after they have
> been rendered. What I'm curious about is if there is a way to cache
> templates before they are rendered so you can provide different
> contexts to them. It seems like there would still be some gains
James Bennett schrieb:
> Manually call get_template() or select_template(), and stuff the
> resulting Template object into a module-global variable somewhere.
> Then just re-use it, calling render() with different contexts, each
> time you need it.
Is there anything speaking against building that
22 matches
Mail list logo