On Fri, 2009-04-03 at 01:24 -0700, robin wrote:
> It seems like you cannot use reverse within urls.py
> 
>   url(r'^add/$','items.views.add_item_wizard',name='add_item_wizard'),
> 
>   url(r'^add/complete/
> $','django.views.generic.simple.direct_to_template',{
>       'template':'message.html',
>       'extra_context':{
>           'title': 'Add Item Complete',
>           'url': reverse('add_item_wizard'),
>       }
>   }, name='add_item_complete'),
> 
> Is there no way?

Somebody has already posted a better solution to this, but I'll confirm
that this is indeed not possible. Partly for implementation reasons (the
reverse resolver needs to know about all the urlpatterns before it can
work, which cannot happen during import, since they haven't been
imported yet).

One day we might add a lazy_reverse that works like this, but that's
some way off into the future. There's pretty much always a workaround or
better solution.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to