Some after-thoughts:
Michael Radziej schrieb:
> The problem is, urls.py knows all about the prefixes where all the model
^^^^^^^ read: point
> If you want to use this stuff somewhere in a view or model, do:
>
> {{{
> from yourapp import urls
> from django.jabberwocky import get_absolute_url
>
> # somewhere deep in the code ...
> get_absolute_url(urls, obj)
> }}}
Or rather, in the model superclass, let's define the method
get_absolute_url(self, urls_module):
return urls_module.url_dict[self._meta.object_name](self)
Michael
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---