On Thu, Dec 10, 2009 at 7:10 AM, Baurzhan Ismagulov <i...@radix50.net> wrote:
> When I try this, I get NoReverseMatch at /apps/: Reverse for 'app-list'
> with arguments '()' and keyword arguments '{}' not found.
>
> I'd like to avoid hard-coding URLs. Is there a way to do that?


the problem is that the call to reverse('app-list') is happening
_before_ the construction of the URL list.

i don't know much about Django internals, but i'd at least try
separating 'app-new' in a different call to patterns() than
'app-list'.

something like:

urlpatterns = patterns('',
   ...
   (r'^apps/$', list_detail.object_list,
    {'queryset': App.objects.all()},
    'app-list')),
)

urlpatterns += patterns('',
   (r'^app/new/$': create_update.create_object,
    {'model': App, 'post_save_redirect': reverse('app-list')},
   'app-new'),
   ...
)


not sure if would work, thought.  it's quite possible that Django
still has work to do after the whole urls.py execution to make
reverse() work.


-- 
Javier

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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