Django - categories & sub-categories
Posted
by Bluey
on Stack Overflow
See other posts from Stack Overflow
or by Bluey
Published on 2010-06-03T08:59:02Z
Indexed on
2010/06/03
9:04 UTC
Read the original article
Hit count: 437
django
|django-models
Some advice needed on how I can structure my models for my site. I have seen this post from Django project but still a little lost.
Also come across Django-MPTT - but that's no help and possibly overkill.
I'm looking to have categories & subcategories that are shown in the URLs like this:
mysite.com/Level1/Maths/Calculations/Addition/
mysite.com/Level3/English/
mysite.com/Level2/English/Storytelling/
In my admin interface I'm looking to have drop downs for each level of category or subcategory. Also at each level I will be querying items (another model) like get all items that have the category 'Level1' AND 'Maths'.
There could also be a situation where I have five or more subcategories.
How is it best to create my models for best performance?
It it worth using tagging instead?
© Stack Overflow or respective owner