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)
>
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
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
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
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
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
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
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
8 matches
Mail list logo