From 22c6497f990fd12359b759a71abfcbf3f52b2d52 Mon Sep 17 00:00:00 2001 From: Alasdair Nicol Date: Sun, 11 Aug 2013 21:19:09 +0100 Subject: 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. --- tests/model_inheritance/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/model_inheritance/models.py') 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 -- cgit v1.2.1