summaryrefslogtreecommitdiff
path: root/tests/admin_widgets/models.py
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/admin_widgets/models.py
parent0fdb692c6c94d912f17a3e2ad12413fb072d38ec (diff)
PEP8 cleanup
Signed-off-by: Jason Myers <jason@jasonamyers.com>
Diffstat (limited to 'tests/admin_widgets/models.py')
-rw-r--r--tests/admin_widgets/models.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/admin_widgets/models.py b/tests/admin_widgets/models.py
index 6a6c6e096b..5d295f0c9b 100644
--- a/tests/admin_widgets/models.py
+++ b/tests/admin_widgets/models.py
@@ -8,6 +8,7 @@ from django.utils.encoding import python_2_unicode_compatible
class MyFileField(models.FileField):
pass
+
@python_2_unicode_compatible
class Member(models.Model):
name = models.CharField(max_length=100)
@@ -18,6 +19,7 @@ class Member(models.Model):
def __str__(self):
return self.name
+
@python_2_unicode_compatible
class Band(models.Model):
name = models.CharField(max_length=100)
@@ -27,6 +29,7 @@ class Band(models.Model):
def __str__(self):
return self.name
+
@python_2_unicode_compatible
class Album(models.Model):
band = models.ForeignKey(Band)
@@ -37,10 +40,12 @@ class Album(models.Model):
def __str__(self):
return self.name
+
class HiddenInventoryManager(models.Manager):
def get_queryset(self):
return super(HiddenInventoryManager, self).get_queryset().filter(hidden=False)
+
@python_2_unicode_compatible
class Inventory(models.Model):
barcode = models.PositiveIntegerField(unique=True)
@@ -55,6 +60,7 @@ class Inventory(models.Model):
def __str__(self):
return self.name
+
class Event(models.Model):
main_band = models.ForeignKey(Band, limit_choices_to=models.Q(pk__gt=0), related_name='events_main_band_at')
supporting_bands = models.ManyToManyField(Band, null=True, blank=True, related_name='events_supporting_band_at')
@@ -64,6 +70,7 @@ class Event(models.Model):
link = models.URLField(blank=True)
min_age = models.IntegerField(blank=True, null=True)
+
@python_2_unicode_compatible
class Car(models.Model):
owner = models.ForeignKey(User)
@@ -73,15 +80,18 @@ class Car(models.Model):
def __str__(self):
return "%s %s" % (self.make, self.model)
+
class CarTire(models.Model):
"""
A single car tire. This to test that a user can only select their own cars.
"""
car = models.ForeignKey(Car)
+
class Honeycomb(models.Model):
location = models.CharField(max_length=20)
+
class Bee(models.Model):
"""
A model with a FK to a model that won't be registered with the admin
@@ -90,6 +100,7 @@ class Bee(models.Model):
"""
honeycomb = models.ForeignKey(Honeycomb)
+
class Individual(models.Model):
"""
A model with a FK to itself. It won't be registered with the admin, so the
@@ -99,9 +110,11 @@ class Individual(models.Model):
name = models.CharField(max_length=20)
parent = models.ForeignKey('self', null=True)
+
class Company(models.Model):
name = models.CharField(max_length=20)
+
class Advisor(models.Model):
"""
A model with a m2m to a model that won't be registered with the admin
@@ -122,6 +135,7 @@ class Student(models.Model):
class Meta:
ordering = ('name',)
+
@python_2_unicode_compatible
class School(models.Model):
name = models.CharField(max_length=255)