Code

Ticket #8705: indentation_modelstxt.diff

File indentation_modelstxt.diff, 2.6 KB (added by Horst Gutmann <zerok@…>, 6 years ago)
Line 
1diff --git a/docs/topics/db/models.txt b/docs/topics/db/models.txt
2index e22660a..a691dbc 100644
3--- a/docs/topics/db/models.txt
4+++ b/docs/topics/db/models.txt
5@@ -143,30 +143,27 @@ optional. They're fully explained in the :ref:`reference
6 ones:
7 
8     :attr:`~Field.null`
9-
10         If ``True``, Django will store empty values as ``NULL`` in the database.
11         Default is ``False``.
12-
13+       
14     :attr:`~Field.blank`
15-
16         If ``True``, the field is allowed to be blank. Default is ``False``.
17-   
18+       
19         Note that this is different than :attr:`~Field.null`.
20         :attr:`~Field.null` is purely database-related, whereas
21         :attr:`~Field.blank` is validation-related. If a field has
22         :attr:`blank=True <Field.blank>`, validation on Django's admin site will
23         allow entry of an empty value. If a field has :attr:`blank=False
24         <Field.blank>`, the field will be required.
25-
26+       
27     :attr:`~Field.choices`
28-
29         An iterable (e.g., a list or tuple) of 2-tuples to use as choices for
30         this field. If this is given, Django's admin will use a select box
31         instead of the standard text field and will limit choices to the choices
32         given.
33-
34+       
35         A choices list looks like this::
36-
37+       
38             YEAR_IN_SCHOOL_CHOICES = (
39                 ('FR', 'Freshman'),
40                 ('SO', 'Sophomore'),
41@@ -176,30 +173,26 @@ ones:
42             )
43             
44     :attr:`~Field.default`
45-
46         The default value for the field. This can be a value or a callable
47         object. If callable it will be called every time a new object is
48         created.
49-   
50+       
51     :attr:`~Field.help_text`
52-
53         Extra "help" text to be displayed under the field on the object's admin
54         form. It's useful for documentation even if your object doesn't have an
55         admin form.
56-
57+       
58     :attr:`~Field.primary_key`
59-
60         If ``True``, this field is the primary key for the model.
61-
62+       
63         If you don't specify :attr:`primary_key=True <Field.primary_key>` for
64         any fields in your model, Django will automatically add an
65         :class:`IntegerField` to hold the primary key, so you don't need to set
66         :attr:`primary_key=True <Field.primary_key>` on any of your fields
67         unless you want to override the default primary-key behavior. For more,
68         see :ref:`automatic-primary-key-fields`.
69-
70+       
71     :attr:`~Field.unique`
72-
73         If ``True``, this field must be unique throughout the table.
74 
75 Again, these are just short descriptions of the most common field options. Full