On Tue, Mar 10, 2009 at 4:17 AM, Muslu Yüksektepe <[email protected] > wrote:
> thanks your answer. i tryed 3 models but i dont know how can i use codes in > templates. > > i setuped mptt but i dont understand anything > oops > > 2009/3/10 Malcolm Tredinnick <[email protected]> > > >> 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 >> >> >> >> > > > -- > Muslu YÜKSEKTEPE > > > > > > The idea of djanog-mptt is to have an N level high tree, that is you only need one category model that has a foreign key to it's parent. It's docs have some example I believe. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

