diff options
author | Alasdair Nicol <alasdair@thenicols.net> | 2013-08-11 21:19:09 +0100 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2013-08-15 19:47:26 -0400 |
commit | 22c6497f990fd12359b759a71abfcbf3f52b2d52 (patch) | |
tree | c04062583cf2cffabc193e635542fa91d99e163e /tests/model_inheritance/models.py | |
parent | 55339a76691724109770092976e660ac62358bc5 (diff) | |
download | django-22c6497f990fd12359b759a71abfcbf3f52b2d52.tar.gz |
Fixed #20895 -- Made check management command warn if a BooleanField does not have a default value
Thanks to Collin Anderson for the suggestion and Tim Graham for
reviewing the patch.
Diffstat (limited to 'tests/model_inheritance/models.py')
-rw-r--r-- | tests/model_inheritance/models.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/model_inheritance/models.py b/tests/model_inheritance/models.py index 2101f394f7..106645d23c 100644 --- a/tests/model_inheritance/models.py +++ b/tests/model_inheritance/models.py @@ -63,7 +63,7 @@ class Attachment(models.Model): return self.content class Comment(Attachment): - is_spam = models.BooleanField() + is_spam = models.BooleanField(default=False) class Link(Attachment): url = models.URLField() @@ -96,8 +96,8 @@ class Rating(models.Model): @python_2_unicode_compatible class Restaurant(Place, Rating): - serves_hot_dogs = models.BooleanField() - serves_pizza = models.BooleanField() + serves_hot_dogs = models.BooleanField(default=False) + serves_pizza = models.BooleanField(default=False) chef = models.ForeignKey(Chef, null=True, blank=True) class Meta(Rating.Meta): @@ -108,7 +108,7 @@ class Restaurant(Place, Rating): @python_2_unicode_compatible class ItalianRestaurant(Restaurant): - serves_gnocchi = models.BooleanField() + serves_gnocchi = models.BooleanField(default=False) def __str__(self): return "%s the italian restaurant" % self.name |