On 12/20/05, Kevin <[EMAIL PROTECTED]> wrote: > Now, that all works, but I'm trying to figure out how to define my > urlconf so that I can specify urls like a filesystem, eg: > www.mydomain.com/albums/2005/may/fishing_trip/ > > I've tried something similar to: > (r'^/albums/(?:([a-z0-9_]+)/)+$', 'mydomain.views.view_album') > > and then: > def view_album(request, *albums): > return HttpResponse(repr(albums)) > > but this always only returns the last match, not all of them as a list. > I know it's a limitation of regular expressions, anyone know a way > around it?
Capture the whole thing, then parse it in your view by splitting on the slash. (r'^/albums/([a-z0-9_/]+))+/$', 'mydomain.views.view_album') def view_album(request, url): bits = url.split('/') # Lookup page by bits. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org