Re: Category list in Django

2009-05-10 Thread Bro
How to create a correct Tree of category ? On 10 mai, 15:51, Bro wrote: > I want to create a list of category with subcategory. > Here is the class : > > class Category(models.Model): >     parent = models.ForeignKey('self', blank=True, null=True) >     name = models.CharField(max_length=63) >  

Re: Category list in Django

2009-05-10 Thread Antoni Aloy
2009/5/10 Bro : > > How to create a correct Tree of category ? > Take a look at django-mptt at http://code.google.com/p/django-mptt/ it would help you a lot. -- Antoni Aloy López Blog: http://trespams.com Site: http://apsl.net --~--~-~--~~~---~--~~ You received

Re: Category list in Django

2009-05-10 Thread Bro
Thanks, I try to use django-mptt. I've installed it but how do you use it ? On 10 mai, 16:15, Antoni Aloy wrote: > 2009/5/10 Bro : > > > How to create a correct Tree of category ? > > Take a look at django-mptt athttp://code.google.com/p/django-mptt/it > would help you a lot. > > -- > Antoni Alo

Re: Category list in Django

2009-05-10 Thread Antoni Aloy
2009/5/10 Bro : > > Thanks, I try to use django-mptt. > I've installed it but how do you use it ? > You have the documentation at: http://django-mptt.googlecode.com/svn/trunk/docs/models.txt mptt will give you lots of extra messages to deal with the category tree. -- Antoni Aloy López Blog: ht

Re: Category list in Django

2009-05-10 Thread Bro
Thanks :) On 10 mai, 17:15, Antoni Aloy wrote: > 2009/5/10 Bro : > > > Thanks, I try to use django-mptt. > > I've installed it but how do you use it ? > > You have the documentation at: > > http://django-mptt.googlecode.com/svn/trunk/docs/models.txt > > mptt will give you lots of extra messages

Re: Category list in Django

2009-05-10 Thread Bro
I use this sample code : from django.db import models import mptt class Genre(models.Model): name = models.CharField(max_length=50, unique=True) parent = models.ForeignKey('self', null=True, blank=True, related_name='children') mptt.register(Genre, order_insertion_by=['n

Re: Category list in Django

2009-05-11 Thread Andy Mikhailenko
Hi, > in register dispatcher.connect(pre_save, > signal=model_signals.pre_save, sender=modem) > AttributeError: 'module' object has no attribute 'connect' Looks like it's time to update your Django installation. regards, Andy --~--~-~--~~~---~--~~ You received t

Re: Category list in Django

2009-05-12 Thread Bro
Big thanks to Matthias and everyone that help me a lot. To correct this error, I get the last Django and Django-mptt trunk. The error is gone :) On 11 mai, 14:19, Andy Mikhailenko wrote: > Hi, > > > in register dispatcher.connect(pre_save, > > signal=model_signals.pre_save, sender=modem) > > At