diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-04-30 09:13:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-30 09:13:23 +0200 |
| commit | 555e3a848e7ac13580371c7eafbc89195fee6ea9 (patch) | |
| tree | f3db796d8b7c9764d77da9444b4ca30150e6d65d /tests/model_inheritance_regress/models.py | |
| parent | bb13711451157d5081c2d2a297820f6bc131ac27 (diff) | |
Removed unused __str__() methods in tests models.
Follow up to 6461583b6cc257d25880ef9a9fd7e2125ac53ce1.
Diffstat (limited to 'tests/model_inheritance_regress/models.py')
| -rw-r--r-- | tests/model_inheritance_regress/models.py | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/tests/model_inheritance_regress/models.py b/tests/model_inheritance_regress/models.py index 5e4c928dc9..1f5f516aac 100644 --- a/tests/model_inheritance_regress/models.py +++ b/tests/model_inheritance_regress/models.py @@ -10,33 +10,21 @@ class Place(models.Model): class Meta: ordering = ('name',) - def __str__(self): - return "%s the place" % self.name - class Restaurant(Place): serves_hot_dogs = models.BooleanField(default=False) serves_pizza = models.BooleanField(default=False) - def __str__(self): - return "%s the restaurant" % self.name - class ItalianRestaurant(Restaurant): serves_gnocchi = models.BooleanField(default=False) - def __str__(self): - return "%s the italian restaurant" % self.name - class ParkingLot(Place): # An explicit link to the parent (we can control the attribute name). parent = models.OneToOneField(Place, models.CASCADE, primary_key=True, parent_link=True) capacity = models.IntegerField() - def __str__(self): - return "%s the parking lot" % self.name - class ParkingLot3(Place): # The parent_link connector need not be the pk on the model. @@ -64,9 +52,6 @@ class Supplier(models.Model): name = models.CharField(max_length=50) restaurant = models.ForeignKey(Restaurant, models.CASCADE) - def __str__(self): - return self.name - class Wholesaler(Supplier): retailer = models.ForeignKey(Supplier, models.CASCADE, related_name='wholesale_supplier') @@ -96,9 +81,6 @@ class Article(models.Model): class Meta: ordering = ('-pub_date', 'headline') - def __str__(self): - return self.headline - class ArticleWithAuthor(Article): author = models.CharField(max_length=100) @@ -126,18 +108,11 @@ class QualityControl(Evaluation): class BaseM(models.Model): base_name = models.CharField(max_length=100) - def __str__(self): - return self.base_name - class DerivedM(BaseM): customPK = models.IntegerField(primary_key=True) derived_name = models.CharField(max_length=100) - def __str__(self): - return "PK = %d, base_name = %s, derived_name = %s" % ( - self.customPK, self.base_name, self.derived_name) - class AuditBase(models.Model): planned_date = models.DateField() @@ -163,9 +138,6 @@ class Person(models.Model): class Meta: ordering = ('name',) - def __str__(self): - return self.name - class AbstractEvent(models.Model): name = models.CharField(max_length=100) @@ -175,9 +147,6 @@ class AbstractEvent(models.Model): abstract = True ordering = ('name',) - def __str__(self): - return self.name - class BirthdayParty(AbstractEvent): pass |
