Opened 15 years ago
Last modified 15 years ago
#11737 closed
many2many recursive relationship do not work in DJ 1.1 — at Initial Version
Reported by: | simon_gray99 | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.1 |
Severity: | Keywords: | many2many recursive | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
from the page at:
http://docs.djangoproject.com/en/dev/ref/models/fields/#recursive-relationships
the sample code does not work:
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
...
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/django/db/models/base.py", line 51, in new
kwargs = {"app_label": model_module.name.split('.')[-2]}
IndexError: list index out of range