I'd like to make sure that this is an error not the feature.
I use following code in template
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.