mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #23283 -- Added default=False to BooleanField's in the docs.
Thanks Baptiste for the suggestion.
This commit is contained in:
parent
e5376999fa
commit
6947885926
4 changed files with 6 additions and 6 deletions
|
@ -21,8 +21,8 @@ In this example, a ``Place`` optionally can be a ``Restaurant``:
|
|||
|
||||
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): # __unicode__ on Python 2
|
||||
return "%s the restaurant" % self.place.name
|
||||
|
|
|
@ -1006,8 +1006,8 @@ For example::
|
|||
address = models.CharField(max_length=80)
|
||||
|
||||
class Restaurant(Place):
|
||||
serves_hot_dogs = models.BooleanField()
|
||||
serves_pizza = models.BooleanField()
|
||||
serves_hot_dogs = models.BooleanField(default=False)
|
||||
serves_pizza = models.BooleanField(default=False)
|
||||
|
||||
All of the fields of ``Place`` will also be available in ``Restaurant``,
|
||||
although the data will reside in a different database table. So these are both
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue