On Tue, 2009-03-10 at 01:12 -0700, Muslu Yüksektepe wrote:
> Hi guys;
> I am preparing one project with Django. i need to make one
> application. it must be categories.
> Like:
> 
> Category1
> ...Subcategory1
> ......Video1
> ......Video2
> ...Subcategory2
> ......Video3
> ......Video4
> 
> Category2
> ...Subcategory3
> ......Video5
> ......Video6
> ...Subcategory4
> ......Video7
> ......Video8
> 
> i wanna use it for videos category and other things.

If you only need three levels and they need to be called "category"
"subcategory" and "product", for example, then create three models that
link to each other with ForeignKey fields.

More likely, though, you are looking for a nested type of structure that
can have many levels. A tree, in models. There are at least two good
existing applications to look at in this space: django-mptt and
django-treebeard (both of them are on Google code and are the first hits
if you search for their respective names).

The django-mptt project contains some template tags to help display the
data in templates. django-treebeard does not, from memory, although
writing your own is not difficult.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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