I have a small hobby project that I have worked on from time to time over 
the years. I started to convert my views to class-based views, and realized 
that I needed to start to use named urls too.

For an url from an url.py like

url(r'^persons/modified/$', 'genealogy.relations.views.persons_modified', 
name="persons-modified"),

it works with the following entry in the template

<p><a href={% url 'persons-modified' %}>Modified</a></p>

but not with

<p><a href={% url persons-modified %}>Modified</a></p>

which I think is according to the documentation: 
https://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-patterns

For the latter case (according to the documentation, I think), I get an 
error

TemplateSyntaxError at / 

Could not parse the remainder: '-modified' from 'persons-modified'

 Request Method: GET  Request URL: http://127.0.0.1:8000/  Django Version: 
1.5.dev20120714103239  Exception Type: TemplateSyntaxError  Exception Value: 

Could not parse the remainder: '-modified' from 'persons-modified'

 Exception Location: /Users/aastrand/git/github/django/django/template/base.py 
in __init__, line 570  Python Executable: 
/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
  Python 
Version: 2.6.5
Can anyone provide an explanation?

Per-Olof


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Hlq3-u5dlAQJ.
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