diff options
| author | Ola Sitarska <ola@sitarska.com> | 2014-08-13 18:33:06 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-08-13 18:23:52 -0400 |
| commit | 69478859261bd1b3e82cc785fddb5e50e3e7645f (patch) | |
| tree | ba3dbc6ac178feccc4c1bebc58d0944a1cced7f8 /docs | |
| parent | e5376999fa9c75efe42ba963a00e2552f66cab9c (diff) | |
Fixed #23283 -- Added default=False to BooleanField's in the docs.
Thanks Baptiste for the suggestion.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/1.7.txt | 2 | ||||
| -rw-r--r-- | docs/topics/db/examples/one_to_one.txt | 4 | ||||
| -rw-r--r-- | docs/topics/db/models.txt | 4 | ||||
| -rw-r--r-- | docs/topics/serialization.txt | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt index 0768a5cf3a..f2a275ed09 100644 --- a/docs/releases/1.7.txt +++ b/docs/releases/1.7.txt @@ -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() diff --git a/docs/topics/db/examples/one_to_one.txt b/docs/topics/db/examples/one_to_one.txt index beb4aa01d9..9e6461d8e6 100644 --- a/docs/topics/db/examples/one_to_one.txt +++ b/docs/topics/db/examples/one_to_one.txt @@ -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 diff --git a/docs/topics/db/models.txt b/docs/topics/db/models.txt index 85fbce4bba..682db34939 100644 --- a/docs/topics/db/models.txt +++ b/docs/topics/db/models.txt @@ -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 diff --git a/docs/topics/serialization.txt b/docs/topics/serialization.txt index 6a89ae4141..225a6b0736 100644 --- a/docs/topics/serialization.txt +++ b/docs/topics/serialization.txt @@ -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:: |
