Re: displaying tree data in admin
Thank you, Daniel, I'm trying to use this: http://magicrebirth.wordpress.com/2009/08/18/django-admin-and-mptt-2/ On Oct 15, 12:09 pm, Daniel Roseman wrote: > On Oct 15, 8:16 am, ev wrote: > > > May be there were developers solutions? Where should I look for? > > Look at the django-mptt project. It implements an efficient algorithm > for tree access, and also has some useful libraries that help with > displaying trees. You might be able to use one of them. > > Alternatively, you could represent the tree simply by making > __unicode__ prefix a series of dashes equal to the level of the > element: > > def __unicode__(self): > return u"%s %s" % ((u'-' * self.level), self.name) > > This would show the elements like this: > root > -level1 > --level2 > ---level3 > > etc. > -- > DR. --~--~-~--~~~---~--~~ 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: displaying tree data in admin
On Oct 15, 8:16 am, ev wrote: > May be there were developers solutions? Where should I look for? > Look at the django-mptt project. It implements an efficient algorithm for tree access, and also has some useful libraries that help with displaying trees. You might be able to use one of them. Alternatively, you could represent the tree simply by making __unicode__ prefix a series of dashes equal to the level of the element: def __unicode__(self): return u"%s %s" % ((u'-' * self.level), self.name) This would show the elements like this: root -level1 --level2 ---level3 etc. -- DR. --~--~-~--~~~---~--~~ 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: displaying tree data in admin
May be there were developers solutions? Where should I look for? On Oct 15, 9:18 am, Михаил Лукин wrote: > There is no sucj feature in admin interface > > On Wed, Oct 14, 2009 at 9:18 PM, ev wrote: > > > I've created model Structure referenced to itself and filled it with > > my data. > > > class Structure(models.Model): > > parent=models.ForeignKey('self', blank=True, null=True, > > related_name='child_set') > > title=models.CharField(max_length=100) > > > Default admin interface shows my data as a plain list. What should I > > do to see my data in a tree? > > -- > regards, > Mihail --~--~-~--~~~---~--~~ 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: displaying tree data in admin
There is no sucj feature in admin interface On Wed, Oct 14, 2009 at 9:18 PM, ev wrote: > > I've created model Structure referenced to itself and filled it with > my data. > > class Structure(models.Model): >parent=models.ForeignKey('self', blank=True, null=True, > related_name='child_set') >title=models.CharField(max_length=100) > > Default admin interface shows my data as a plain list. What should I > do to see my data in a tree? > > > > -- regards, Mihail --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
displaying tree data in admin
I've created model Structure referenced to itself and filled it with my data. class Structure(models.Model): parent=models.ForeignKey('self', blank=True, null=True, related_name='child_set') title=models.CharField(max_length=100) Default admin interface shows my data as a plain list. What should I do to see my data in a tree? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---