That's totally it. The reverse function is fairly stupid (for speed),  
and it always goes for the first match. You've got two URLS with the  
same view. That's when it's time for:
http://www.djangoproject.com/documentation/url_dispatch/#naming-url-patterns


> No, I don't think thats it.  Like I said, if I reverse the elections
> and precincts url in the urls.py file (the main one), it happens
> exactly opposite.  Whichever one is listed first in the urls.py file
> works, while the other one doesn't.

>> On Apr 18, 1:14 pm, jeffself <[EMAIL PROTECTED]> wrote:
>>
>>> My project contains two apps, elections and precincts.  My main
>>> urls.py file looks like this:
>>
>>> from django.conf.urls.defaults import *
>>
>>> urlpatterns = patterns('',
>>>   (r'^precincts/', include('precincts.urls')),
>>>   (r'^elections/', include('elections.urls')),
>>>   (r'^admin/', include('django.contrib.admin.urls')),
>>> )
>>
>>> The urls.py file under my precincts app looks like this:

<SNIP>

>>> urlpatterns += patterns('django.views.generic.list_detail',
>>>       (r'^(?P<slug>[\w-]+)/$', 'object_detail',  
>>> precinct_detail_info),
>>> )
>>
>>> And my urls.py file under my elections app looks like this:


<SNIP>

>>> urlpatterns += patterns('django.views.generic.list_detail',
>>>   (r'^(?P<slug>[\w-]+)/$', 'object_detail', election_detail_info),
>>> )

-- 
Peter of the Norse

-- 
Peter of the Norse


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to