searching by slug not working in cases with spaces (that really rolls off the tongue)

2010-06-05 Thread joelklabo
I am trying to capture the slug from a URL to search and find the object with that slug. Here is my URLconf: (r'^brewery/(\w+)', breweryDetail), It works when there are no spaces in the slug, but nothing comes up when there are. There are no errors just no results showing up. Here is my v

Re: searching by slug not working in cases with spaces (that really rolls off the tongue)

2010-06-06 Thread joelklabo
bumping this, I'm still at a loss... On Jun 5, 1:28 pm, joelklabo wrote: > I am trying to capture the slug from a URL to search and find the > object with that slug. Here is my URLconf: > >         (r'^brewery/(\w+)', breweryDetail), > > It works when there are no spaces in the slug, but nothing

Re: searching by slug not working in cases with spaces (that really rolls off the tongue)

2010-06-06 Thread James Gregory
The regex class "\w" doesn't include spaces, so maybe you need (r'^brewery/([\w ]+). Then again spaces in urls are represented as "%20", so maybe you need (r'^brewery/([\w%]+), can't be bothered to test right now. Or maybe I'm totally wrong. James On Jun 7, 3:05 am, joelklabo wrote: > bumping th

Re: searching by slug not working in cases with spaces (that really rolls off the tongue)

2010-06-06 Thread James Gregory
or, if there's nothing that comes beneath brewery, just (r'^brewery/(. +) On Jun 7, 3:17 am, James Gregory wrote: > The regex class "\w" doesn't include spaces, so maybe you need > (r'^brewery/([\w ]+). Then again spaces in urls are represented as > "%20", so maybe you need (r'^brewery/([\w%]+),

Re: searching by slug not working in cases with spaces (that really rolls off the tongue)

2010-06-06 Thread joelklabo
Yes! Thank you! I just used the (.+) for now, it's working. On Jun 6, 7:23 pm, James Gregory wrote: > or, if there's nothing that comes beneath brewery, just (r'^brewery/(. > +) > > On Jun 7, 3:17 am, James Gregory wrote: > > > > > The regex class "\w" doesn't include spaces, so maybe you need >