1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

[1.7.x] Further consolidated the model_inheritance tests.

Backport of 3f01e82 from master
This commit is contained in:
Aymeric Augustin
2014-04-21 11:50:53 +02:00
parent ab0afef959
commit 0dad0ca55e
5 changed files with 27 additions and 68 deletions

View File

@@ -73,9 +73,14 @@ class ParkingLot4B(Place, ParkingLot4):
pass
@python_2_unicode_compatible
class Supplier(models.Model):
name = models.CharField(max_length=50)
restaurant = models.ForeignKey(Restaurant)
def __str__(self):
return self.name
class Wholesaler(Supplier):
retailer = models.ForeignKey(Supplier, related_name='wholesale_supplier')