Hey guys, got myself stumped and I'm hoping you could help me figure
this one out.  In my code I've got a hierarchical category structure
for my model that's intended to roughly analogize a filesystem, eg:

class Album(meta.Model):
    location = meta.SlugField()
    name = meta.CharField()
    parent = meta.ForeignKey('self', null=True)


And then I build up these albums as directories, eg:

a = Album(location='2005')
a.save()
b = Album(location='May', parent=a)
b.save()

etc....

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?  Id rather not go to:

r'/albums/(?P<album_id>\d+)/$' and keep the more readable urls....

Reply via email to