mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.6.x] 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.
Backport of 22c6497f99 from master
This commit is contained in:
committed by
Tim Graham
parent
7825fb8788
commit
919934602f
@@ -22,8 +22,8 @@ class Place(models.Model):
|
||||
@python_2_unicode_compatible
|
||||
class Restaurant(models.Model):
|
||||
place = models.OneToOneField(Place, primary_key=True)
|
||||
serves_hot_dogs = models.BooleanField()
|
||||
serves_pizza = models.BooleanField()
|
||||
serves_hot_dogs = models.BooleanField(default=False)
|
||||
serves_pizza = models.BooleanField(default=False)
|
||||
|
||||
def __str__(self):
|
||||
return "%s the restaurant" % self.place.name
|
||||
|
||||
Reference in New Issue
Block a user