Re: Category list in Django
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 Mikhailenkowrote: > 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 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 -~--~~~~--~~--~--~---
Re: Category list in Django
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 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 -~--~~~~--~~--~--~---
Re: Category list in Django
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=['name']) But Django send me this error : in register dispatcher.connect(pre_save, signal=model_signals.pre_save, sender=modem) AttributeError: 'module' object has no attribute 'connect' On 10 mai, 17:57, Browrote: > 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 to deal with the category tree. > > > -- > > Antoni Aloy López > > Blog:http://trespams.com > > Site:http://apsl.net --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Category list in Django
Thanks :) On 10 mai, 17:15, Antoni Aloywrote: > 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:http://trespams.com > Site:http://apsl.net --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Category list in Django
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: http://trespams.com Site: http://apsl.net --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Category list in Django
Thanks, I try to use django-mptt. I've installed it but how do you use it ? On 10 mai, 16:15, Antoni Aloywrote: > 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 Aloy López > Blog:http://trespams.com > Site:http://apsl.net --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Category list in Django
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 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 -~--~~~~--~~--~--~---
Re: Category list in Django
How to create a correct Tree of category ? On 10 mai, 15:51, Browrote: > 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) > child_list = [] > def __unicode__(self): > return self.name > > I use this to create a tree : > > def show_categories(): > category_list = list(Category.objects.all()) > for category in category_list: > if category.parent != None: > category.parent.child_list.append(category) > category_list.remove(category) > return {'category_list':category_list} > > Do you think it is a good idea ? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---