I'd like to make sure that this is an error not the feature.

I use following code in template

<li><a href="{% url 'player-select' player.id %}">{{ player.id }} : "{{ 
player.name}}"</a></li>

And in urls.py everything goes fine with those rules:

1. url(r'^player/select/(?P<playerId>\d+)/$', myapp.views.player.select, 
name="player-select"),
result URL is: /player/select/1/

or:

2. url(r'^player/select/(?P<playerId>\d+)/?$', myapp.views.player.select, 
name="player-select"),
result URL is: /player/select/1

or:

3. url(r'^player/select/(?P<playerId>\d+)?/?$', myapp.views.player.select, 
name="player-select"),
result URL is: /player/select/1

but with this rule I get error:

4. url(r'^player/select/((?P<playerId>\d+)/)?$', 
neuroapp.views.player.select, name="player-select"),
error message:
Reverse for 'player-select' with arguments '(1L,)' and keyword arguments 
'{}' not found. 1 pattern(s) tried: ['player/select/((?P<playerId>\\d+)/)?
#39;]

for me 4th pattern is pretty much the same as 3rd, but Django has other 
opinion. If you can, please explain me why.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/35dfc988-f234-42a0-8ded-cbacd84e6c55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to