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 | |
parent | bb13711451157d5081c2d2a297820f6bc131ac27 (diff) | |
download | django-555e3a848e7ac13580371c7eafbc89195fee6ea9.tar.gz |
Removed unused __str__() methods in tests models.
Follow up to 6461583b6cc257d25880ef9a9fd7e2125ac53ce1.
Diffstat (limited to 'tests/model_inheritance')
-rw-r--r-- | tests/model_inheritance/models.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/tests/model_inheritance/models.py b/tests/model_inheritance/models.py index 58c076d536..fa37e121ea 100644 --- a/tests/model_inheritance/models.py +++ b/tests/model_inheritance/models.py @@ -61,9 +61,6 @@ class Attachment(models.Model): class Meta: abstract = True - def __str__(self): - return self.content - class Comment(Attachment): is_spam = models.BooleanField(default=False) @@ -80,17 +77,11 @@ class Link(Attachment): class Chef(models.Model): name = models.CharField(max_length=50) - def __str__(self): - return "%s the chef" % self.name - class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) - def __str__(self): - return "%s the place" % self.name - class Rating(models.Model): rating = models.IntegerField(null=True, blank=True) @@ -108,32 +99,20 @@ class Restaurant(Place, Rating): class Meta(Rating.Meta): db_table = 'my_restaurant' - 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 Supplier(Place): customers = models.ManyToManyField(Restaurant, related_name='provider') - def __str__(self): - return "%s the supplier" % 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) main_site = models.ForeignKey(Place, models.CASCADE, related_name='lot') - def __str__(self): - return "%s the parking lot" % self.name - # # Abstract base classes with related models where the sub-class has the |