mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Changed all model unit tests to use __str__() instead of __repr__(). Also slightly changed related-object DoesNotExist exception message to use repr instead of str
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3075 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
55e453a09c
commit
a5b7c29816
28 changed files with 341 additions and 336 deletions
|
@ -10,20 +10,20 @@ class Place(models.Model):
|
|||
name = models.CharField(maxlength=50)
|
||||
address = models.CharField(maxlength=80)
|
||||
|
||||
def __repr__(self):
|
||||
def __str__(self):
|
||||
return "%s the place" % self.name
|
||||
|
||||
class Restaurant(Place):
|
||||
serves_hot_dogs = models.BooleanField()
|
||||
serves_pizza = models.BooleanField()
|
||||
|
||||
def __repr__(self):
|
||||
def __str__(self):
|
||||
return "%s the restaurant" % self.name
|
||||
|
||||
class ItalianRestaurant(Restaurant):
|
||||
serves_gnocchi = models.BooleanField()
|
||||
|
||||
def __repr__(self):
|
||||
def __str__(self):
|
||||
return "%s the italian restaurant" % self.name
|
||||
|
||||
API_TESTS = """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue