For a real simple solution you might just set up a foreign key field
that points to the parent of any given category. (If you don't need
the extra features of those libraries, they might just make things
more complicated.)

E.g. subcat1-1-1 and subcat1-1-2 are fk'ed to subcat1-1.
subcat1-1 is fk'ed to cat1
Anything with a null fk field is a top level category.

I might call the fk field parent, and set the related_name of the
foreign key to children. Then you could access stuff like this:
>>>subcat1-1.parent
<cat1>
>>>subcat1-1.children.all()
[ <subcat1-1-1> , <subcat1-1-2>]

Anyway, it works in my head. I haven't actually coded any of it.
Hope that helps,
Alex

On Apr 27, 8:52 am, joker <musluyuksekt...@gmail.com> wrote:
> how can i use unlimited category?
>
> like
>
> category1
>     subcategory1-1
>          subcategory1-1-1
>          subcategory1-1-2
>          subcategory1-1-3
>                subcategory1-1-3-1
>                subcategory1-1-3-2
>     subcategory1-2
>
> category2
>     subcategory2-1
>     subcategory2-2
--~--~---------~--~----~------------~-------~--~----~
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