summaryrefslogtreecommitdiff
path: root/tests/m2m_through_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_through_regress
parent0fdb692c6c94d912f17a3e2ad12413fb072d38ec (diff)
downloaddjango-7a61c68c50d3837c50e35c252fd76220f08b5290.tar.gz
PEP8 cleanup
Signed-off-by: Jason Myers <jason@jasonamyers.com>
Diffstat (limited to 'tests/m2m_through_regress')
-rw-r--r--tests/m2m_through_regress/models.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/m2m_through_regress/models.py b/tests/m2m_through_regress/models.py
index 91e1aa8cc1..c49e5b02eb 100644
--- a/tests/m2m_through_regress/models.py
+++ b/tests/m2m_through_regress/models.py
@@ -15,6 +15,7 @@ class Membership(models.Model):
def __str__(self):
return "%s is a member of %s" % (self.person.name, self.group.name)
+
# using custom id column to test ticket #11107
@python_2_unicode_compatible
class UserMembership(models.Model):
@@ -26,6 +27,7 @@ class UserMembership(models.Model):
def __str__(self):
return "%s is a user and member of %s" % (self.user.username, self.group.name)
+
@python_2_unicode_compatible
class Person(models.Model):
name = models.CharField(max_length=128)
@@ -33,6 +35,7 @@ class Person(models.Model):
def __str__(self):
return self.name
+
@python_2_unicode_compatible
class Group(models.Model):
name = models.CharField(max_length=128)
@@ -43,17 +46,21 @@ class Group(models.Model):
def __str__(self):
return self.name
+
# A set of models that use an non-abstract inherited model as the 'through' model.
class A(models.Model):
a_text = models.CharField(max_length=20)
+
class ThroughBase(models.Model):
a = models.ForeignKey(A)
b = models.ForeignKey('B')
+
class Through(ThroughBase):
extra = models.CharField(max_length=20)
+
class B(models.Model):
b_text = models.CharField(max_length=20)
a_list = models.ManyToManyField(A, through=Through)
@@ -68,6 +75,7 @@ class Car(models.Model):
def __str__(self):
return "%s" % self.make
+
@python_2_unicode_compatible
class Driver(models.Model):
name = models.CharField(max_length=20, unique=True, null=True)
@@ -78,6 +86,7 @@ class Driver(models.Model):
class Meta:
ordering = ('name',)
+
@python_2_unicode_compatible
class CarDriver(models.Model):
car = models.ForeignKey('Car', to_field='make')