diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-02-22 14:04:13 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-02-22 14:04:13 +0000 |
| commit | e6db084ac8fdf04ba20b5976a1cebfb77d55c97e (patch) | |
| tree | 71f65cecdc2ea74c94a3e1f6c3462d7f925c9357 /tests/regressiontests/m2m_regress | |
| parent | eb67e449dde298a35664c0daea61860ac63a1f58 (diff) | |
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.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12489 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/m2m_regress')
| -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. |
