or, if there's nothing that comes beneath brewery, just (r'^brewery/(.
+)

On Jun 7, 3:17 am, James Gregory <james....@gmail.com> 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%]+), can't be bothered to
> test right now. Or maybe I'm totally wrong.
>
> James
>
> On Jun 7, 3:05 am, joelklabo <joelkl...@gmail.com> wrote:
>
> > bumping this, I'm still at a loss...
>
> > On Jun 5, 1:28 pm, joelklabo <joelkl...@gmail.com> 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 comes up
> > > when there are. There are no errors just no results showing up.
> > > Here is my view code:
>
> > > def breweryDetail(request, brewerySlug):
> > >         brews = Brew.objects.filter(brewerySlug__exact=brewerySlug)
> > >         return render_to_response('brewery_detail.html', {'brews': brews})
>
> > > Anyone have any ideas?

-- 
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