diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-02-26 11:12:14 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-02-26 11:12:14 +0000 |
| commit | a52f1dd95c87bca8c5edc69a487d1a5069ddd7cd (patch) | |
| tree | d2e2d0ee5567be29386ab38e4997d0c2d0e3a973 /tests/regressiontests | |
| parent | 6ca3154bcd14f377ba38f1199f6053ec94e59651 (diff) | |
[1.1.X] Fixed #11226 -- Corrected an validation edge case with m2m relations between two models with the same class name. Thanks to pkoch for the report, and to Ramiro Morales for the patch.
Backport of r12489 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12596 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/m2m_regress/models.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/regressiontests/m2m_regress/models.py b/tests/regressiontests/m2m_regress/models.py index 913e719902..7f6da3341b 100644 --- a/tests/regressiontests/m2m_regress/models.py +++ b/tests/regressiontests/m2m_regress/models.py @@ -1,4 +1,5 @@ from django.db import models +from django.contrib.auth import models as auth # No related name is needed here, since symmetrical relations are not # explicitly reversible. @@ -41,6 +42,14 @@ class Worksheet(models.Model): id = models.CharField(primary_key=True, max_length=100) lines = models.ManyToManyField(Line, blank=True, null=True) +# Regression for #11226 -- A model with the same name that another one to +# which it has a m2m relation. This shouldn't cause a name clash between +# the automatically created m2m intermediary table FK field names when +# running syncdb +class User(models.Model): + name = models.CharField(max_length=30) + friends = models.ManyToManyField(auth.User) + __test__ = {"regressions": """ # Multiple m2m references to the same model or a different model must be # distinguished when accessing the relations through an instance attribute. |
