many2many recursive relationship do not work in DJ 1.1 - second problem
|Reported by:||simon_gray99||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.1|
|Severity:||Keywords:||many2many recursive missing tables|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Description (last modified by )
According to the page at:
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!