Added a ManyToManyField(db_constraint=False) option, this allows not creating constraints on the intermediary models.

This commit is contained in:
Alex Gaynor 2013-03-07 11:24:51 -08:00
parent 4cccb85e29
commit bbbd698c7a
5 changed files with 65 additions and 22 deletions

View file

@ -90,7 +90,10 @@ class Item(models.Model):
@python_2_unicode_compatible
class Object(models.Model):
pass
related_objects = models.ManyToManyField("self", db_constraint=False, symmetrical=False)
def __str__(self):
return str(self.id)
@python_2_unicode_compatible