mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
PEP8 cleanup
Signed-off-by: Jason Myers <jason@jasonamyers.com>
This commit is contained in:
parent
0fdb692c6c
commit
7a61c68c50
128 changed files with 739 additions and 206 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue