URL Dispatcher with optional "parameters"

33 views
Skip to first unread message

Agony

unread,
Jul 2, 2009, 6:30:24 PM7/2/09
to Django users
Hello,

I am trying to create a view that has a lot of optional parameters,
each of these should be able to left out of not according to the
situation so for example:

/article/(title) -- shows the abriged article
/article/(title)/revision/(revision_id) -- shows the given revision of
the article
/article/(title)/print --show print version of the article
/article/(title)/revision/(revision_id)/print -- shows the print
version of the given revision of the article

So in this case there are 4 possible urls with just two optional
arguments, in the app I am trying to make there are at least 5
optional parameters, which would result in 32 possible urls, not very
pleasant stuff to work with.

Another problem in this the {% url %} function does not support named
parameters, but I can live with that by sending the full parameter
list on each call.


Please someone help
Reply all
Reply to author
Forward
0 new messages