Alex, thanks, now it work. now have a new problem is may a group can contain itself, this will be a loop.
how to avoid this condition? On Tue, Feb 10, 2009 at 11:28 AM, Alex Gaynor <alex.gay...@gmail.com> wrote: > > > On Mon, Feb 9, 2009 at 10:18 PM, khsing <khsing...@gmail.com> wrote: >> >> I want design a group that can contain other groups, and one group can >> belong many groups. >> >> I write such code below, but not right. >> >> class Group(models.Model): >> groups = models.ManyToManyField(Group) >> >> any suggestion? >> >> or how to design such a group. >> >> thanks. >> >> -- >> A man live in jail and want to break. >> http://blog.khsing.net >> >> > > To have a relationship with oneself you do > > ManyToManyField("self") > > -- > "I disapprove of what you say, but I will defend to the death your right to > say it." --Voltaire > "The people's good is the highest law."--Cicero > > > > -- A man live in jail and want to break. http://blog.khsing.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 -~----------~----~----~----~------~----~------~--~---