Actually, it's not the url() function that makes it work, it's specifying the 
view function by name.

urlpatterns = patterns('',
    (r'^FaceSearch/search/$', 'facesearch.views.start_search'),
)

works,

from facesearch.views import start_search
urlpatterns = patterns('',
    (r'^FaceSearch/search/$', start_search),
)

doesn't.

Why doesn't it work when you pass a function reference for the view? When you 
put a string in patterns, reverse() works by sting or function reference.

http://docs.djangoproject.com/en/dev/topics/http/urls/#reverse seems to imply 
that it should work either way. Is this a bug?

Cheers,

Ian Cullinan

-----Original Message-----
From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com] On 
Behalf Of Ian Cullinan
Sent: Friday, 16 January 2009 10:57 AM
To: django-users@googlegroups.com
Subject: RE: reverse() problems (NoReverseMatch)


Using the url() function in patterns made it work (even without the name), 
thanks!

Now I just have to make it work in my storage manager :)

-----Original Message-----
From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com] On 
Behalf Of Dj Gilcrease
Sent: Friday, 16 January 2009 10:45 AM
To: django-users@googlegroups.com
Subject: Re: reverse() problems (NoReverseMatch)


try

from django.conf.urls.defaults import *

urlpatterns = patterns('',
      url(r'^FaceSearch/search/$', 'facesearch.views.start_search',
name="face-search'),
)

============
from django.core.urlresolvers import reverse
reverse('face-search')

Dj Gilcrease
OpenRPG Developer
~~http://www.openrpg.com

--~--~---------~--~----~------------~-------~--~----~
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