On Dec 3, 2:11 am, Rob <r...@wieskamp.nl> wrote:
> I want to make main categories on my site like:
> /main1/page1
> /main2/page2
> /main3/page3

It sounds like you have 3 views, and each one can pick from a pool of
categories.  If this is correct, all you need to do is enter a line
for each view (main#), and pass the category (page#) as a variable to
the view, which can then do the lookup.  You will use something like:

r'^main1/\w+/$'

which will pass all characters matching the regex (here, alphanumeric
chars) to the view you specify as a positional arg.  You can also pass
them as a kwarg.  Read here:  
http://docs.djangoproject.com/en/dev/topics/http/urls/

>
> Is there a way to do something like: (r'^(.*)/(.*)/$', view), (I know
> this doesn't work)

To do something like that, instead of wildcarding everything greedily,
just pass a range of characters and symbols you will not accept
(whitespace, etc.) by using [^don't_accept_these] in your regex.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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