#11738: many2many recursive relationship do not work in DJ 1.1 - second problem ------------------------------------+--------------------------------------- Reporter: simon_gray99 | Owner: nobody Status: new | Milestone: Component: Uncategorized | Version: 1.1 Resolution: | Keywords: many2many recursive missing tables Stage: Unreviewed | Has_patch: 0 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | ------------------------------------+--------------------------------------- Old description:
> According to the page at: > http://www.djangoproject.com/documentation/models/m2m_recursive/ > > All that is required to produce a recursive many2many is the following > code: > from django.db import models > > class Person(models.Model): > name = models.CharField(max_length=20) > friends = models.ManyToManyField('self') > idols = models.ManyToManyField('self', symmetrical=False, > related_name='stalkers') > > def __unicode__(self): > return self.name > > When I try this exact same code in my application, > > I get an immediate complaint that the table 'persons_idols' does not > exist. > > If I CREATE this table manually then things are OK but the documentation > state that DJ is supposed to handle creating this > table when the 'through' flag is NOT used... it doesn't! > > Please advise New description: According to the page at: http://www.djangoproject.com/documentation/models/m2m_recursive/ All that is required to produce a recursive many2many is the following code: {{{ from django.db import models class Person(models.Model): name = models.CharField(max_length=20) friends = models.ManyToManyField('self') idols = models.ManyToManyField('self', symmetrical=False, related_name='stalkers') def __unicode__(self): return self.name }}} When I try this exact same code in my application, I get an immediate complaint that the table 'persons_idols' does not exist. If I CREATE this table manually then things are OK but the documentation state that DJ is supposed to handle creating this table when the 'through' flag is NOT used... it doesn't! Please advise Comment (by Alex): Please use the preview button. -- Ticket URL: <http://code.djangoproject.com/ticket/11738#comment:2> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---