Re: Multiple URLs, Common View

2010-07-22 Thread Phil Edwards
On 20/07/10 13:01, joconnell wrote: > Hi, > > If you use something like > > r'^(?P.+)/$' > > then a variable called page will get passed to your view. It will > contain the string that has been matched against the specified pattern > (in this case any character 1 or more times (.+)) > Thanks J

Re: Multiple URLs, Common View

2010-07-20 Thread joconnell
Hi, If you use something like r'^(?P.+)/$' then a variable called page will get passed to your view. It will contain the string that has been matched against the specified pattern (in this case any character 1 or more times (.+)) I think django uses standard python regular expressions in its ur

Re: Multiple URLs, Common View

2010-07-19 Thread Zaheer Soebhan
Maybe make a pattern like r'(home|about|family|aviation|linux|etc)$' to match either home, about, family, etc? The "|" should work like the "OR"-operator. 2010/7/19 Ryan Osborn > You could try using this as your pattern: > > (?P[a-zA-Z0-9-]+) > > Ryan > > On Jul 19, 1:03 am, Phil Edwards wrote:

Re: Multiple URLs, Common View

2010-07-19 Thread Ryan Osborn
You could try using this as your pattern: (?P[a-zA-Z0-9-]+) Ryan On Jul 19, 1:03 am, Phil Edwards wrote: > On 18/07/2010 23:55, Phil Edwards wrote: > > > > > -begin- > > def servePage(request): > > if request.path[1:] == '': > > thisPage = Page.objects.get(name = unicode('home')) > > el

Re: Multiple URLs, Common View

2010-07-18 Thread Phil Edwards
On 18/07/2010 23:55, Phil Edwards wrote: -begin- def servePage(request): if request.path[1:] == '': thisPage = Page.objects.get(name = unicode('home')) else: thisPage = Page.objects.get(name = unicode(request.path[1:])) sidebar_list = Page.objects.filter(category = thisPage.category) art