diff -r cef9b5a51e89 docs/topics/db/models.txt
a
|
b
|
|
143 | 143 | ones: |
144 | 144 | |
145 | 145 | :attr:`~Field.null` |
146 | | |
147 | 146 | If ``True``, Django will store empty values as ``NULL`` in the database. |
148 | 147 | Default is ``False``. |
149 | 148 | |
150 | 149 | :attr:`~Field.blank` |
| 150 | If ``True``, the field is allowed to be blank. Default is ``False``. |
151 | 151 | |
152 | | If ``True``, the field is allowed to be blank. Default is ``False``. |
153 | | |
154 | 152 | Note that this is different than :attr:`~Field.null`. |
155 | 153 | :attr:`~Field.null` is purely database-related, whereas |
156 | 154 | :attr:`~Field.blank` is validation-related. If a field has |
… |
… |
|
159 | 157 | <Field.blank>`, the field will be required. |
160 | 158 | |
161 | 159 | :attr:`~Field.choices` |
162 | | |
163 | 160 | An iterable (e.g., a list or tuple) of 2-tuples to use as choices for |
164 | 161 | this field. If this is given, Django's admin will use a select box |
165 | 162 | instead of the standard text field and will limit choices to the choices |
… |
… |
|
174 | 171 | ('SR', 'Senior'), |
175 | 172 | ('GR', 'Graduate'), |
176 | 173 | ) |
177 | | |
| 174 | |
178 | 175 | :attr:`~Field.default` |
179 | | |
180 | 176 | The default value for the field. This can be a value or a callable |
181 | 177 | object. If callable it will be called every time a new object is |
182 | 178 | created. |
183 | | |
| 179 | |
184 | 180 | :attr:`~Field.help_text` |
185 | | |
186 | 181 | Extra "help" text to be displayed under the field on the object's admin |
187 | 182 | form. It's useful for documentation even if your object doesn't have an |
188 | 183 | admin form. |
189 | 184 | |
190 | 185 | :attr:`~Field.primary_key` |
191 | | |
192 | 186 | If ``True``, this field is the primary key for the model. |
193 | 187 | |
194 | 188 | If you don't specify :attr:`primary_key=True <Field.primary_key>` for |
… |
… |
|
199 | 193 | see :ref:`automatic-primary-key-fields`. |
200 | 194 | |
201 | 195 | :attr:`~Field.unique` |
202 | | |
203 | 196 | If ``True``, this field must be unique throughout the table. |
204 | 197 | |
205 | 198 | Again, these are just short descriptions of the most common field options. Full |