1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Removed unused __str__() methods in tests models.

Follow up to 6461583b6c.
This commit is contained in:
Mariusz Felisiak
2020-04-30 09:13:23 +02:00
committed by GitHub
parent bb13711451
commit 555e3a848e
35 changed files with 2 additions and 400 deletions

View File

@@ -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