Re: URL Patterns for Nested Catagories.

2010-04-07 Thread Streamweaver
Thanks again. Just following up with my model to show how I'm implementing based on the advice above. Note I call my categories model Topics instead but you get the picture. class Topic(models.Model): ''' Topics form sections and categories of posts to enable topical based conversati

Re: URL Patterns for Nested Catagories.

2010-04-07 Thread Streamweaver
Big thanks for the reply. I already have a custom save method on the Catagory for slugs so it'll be easy enough to create a path. I may not understand the suggested implementation very well but it sounds like I may not have to do a split at all if I store the sluggified path then I think all I sh

Re: URL Patterns for Nested Catagories.

2010-04-07 Thread Tim Shaffer
Oh, check out the Category class from django-simplecms. It implements the first method. Specifically, check out the save() method that builds the path based on all the parent categories if it doesn't exist. http://code.google.com/p/django-simplecms/source/browse/trunk/simplecms/cms/models.py#47

Re: URL Patterns for Nested Catagories.

2010-04-07 Thread Tim Shaffer
> I suppose I could do something like r'^(?P.*)$' and then parse path in > the view but this could wreak havoc with other URLs. Yes, that's the way to do it. You can prevent it from clashing with other URLs by prefixing it with something like categories/ so the URL would be: www.example.com/cate

URL Patterns for Nested Catagories.

2010-04-07 Thread Streamweaver
The thing I'm having trouble wrapping my head around is how would I setup URL Patterns for nested catagories when it may have any number of extra layers? Say I had a set of nested catagories like Parent - Child Level 1 - Child Level 2 which I would expect to have a url like: /paren