Skip to content

Commit

Permalink
[1.7.x] Fixed #23283 -- Added default=False to BooleanField's in the …
Browse files Browse the repository at this point in the history
…docs.

Thanks Baptiste for the suggestion.

Backport of 6947885 from master
  • Loading branch information
olasitarska authored and timgraham committed Aug 13, 2014
1 parent 05063c6 commit 0f44d9f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/releases/1.7.txt
Expand Up @@ -185,7 +185,7 @@ class method can now directly :ref:`create Manager with QuerySet methods

class Food(models.Model):
kind = models.CharField(max_length=50)
vegetarian = models.BooleanField()
vegetarian = models.BooleanField(default=False)
objects = FoodQuerySet.as_manager()

Food.objects.pizzas().vegetarian()
Expand Down
4 changes: 2 additions & 2 deletions docs/topics/db/examples/one_to_one.txt
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/topics/db/models.txt
Expand Up @@ -1005,8 +1005,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
Expand Down
2 changes: 1 addition & 1 deletion docs/topics/serialization.txt
Expand Up @@ -84,7 +84,7 @@ model will be serialized. For example, consider the following models::
name = models.CharField(max_length=50)

class Restaurant(Place):
serves_hot_dogs = models.BooleanField()
serves_hot_dogs = models.BooleanField(default=False)

If you only serialize the Restaurant model::

Expand Down

0 comments on commit 0f44d9f

Please sign in to comment.