summaryrefslogtreecommitdiff
path: root/tests/m2m_regress
diff options
context:
space:
mode:
authorJason Myers <jason@jasonamyers.com>2013-11-02 23:36:09 -0500
committerJason Myers <jason@jasonamyers.com>2013-11-02 23:50:49 -0500
commit7a61c68c50d3837c50e35c252fd76220f08b5290 (patch)
tree586f16a3f02c2b45ffb3dd2af834c0ef604e099c /tests/m2m_regress
parent0fdb692c6c94d912f17a3e2ad12413fb072d38ec (diff)
PEP8 cleanup
Signed-off-by: Jason Myers <jason@jasonamyers.com>
Diffstat (limited to 'tests/m2m_regress')
-rw-r--r--tests/m2m_regress/models.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/m2m_regress/models.py b/tests/m2m_regress/models.py
index abd012b3d0..48fdad9304 100644
--- a/tests/m2m_regress/models.py
+++ b/tests/m2m_regress/models.py
@@ -2,6 +2,7 @@ from django.contrib.auth import models as auth
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
+
# No related name is needed here, since symmetrical relations are not
# explicitly reversible.
@python_2_unicode_compatible
@@ -13,6 +14,7 @@ class SelfRefer(models.Model):
def __str__(self):
return self.name
+
@python_2_unicode_compatible
class Tag(models.Model):
name = models.CharField(max_length=10)
@@ -20,6 +22,7 @@ class Tag(models.Model):
def __str__(self):
return self.name
+
# Regression for #11956 -- a many to many to the base class
@python_2_unicode_compatible
class TagCollection(Tag):
@@ -28,6 +31,7 @@ class TagCollection(Tag):
def __str__(self):
return self.name
+
# A related_name is required on one of the ManyToManyField entries here because
# they are both addressable as reverse relations from Tag.
@python_2_unicode_compatible
@@ -39,21 +43,26 @@ class Entry(models.Model):
def __str__(self):
return self.name
+
# Two models both inheriting from a base model with a self-referential m2m field
class SelfReferChild(SelfRefer):
pass
+
class SelfReferChildSibling(SelfRefer):
pass
+
# Many-to-Many relation between models, where one of the PK's isn't an Autofield
class Line(models.Model):
name = models.CharField(max_length=100)
+
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