mirror of
https://github.com/django/django.git
synced 2025-08-31 07:47:37 +00:00
Changed tuple choices to list in docs.
This commit is contained in:
parent
717362d810
commit
97d3321e89
8 changed files with 27 additions and 27 deletions
|
@ -258,17 +258,17 @@ Model style
|
|||
* ``def get_absolute_url()``
|
||||
* Any custom methods
|
||||
|
||||
* If ``choices`` is defined for a given model field, define each choice as
|
||||
a tuple of tuples, with an all-uppercase name as a class attribute on the
|
||||
model. Example::
|
||||
* If ``choices`` is defined for a given model field, define each choice as a
|
||||
list of tuples, with an all-uppercase name as a class attribute on the model.
|
||||
Example::
|
||||
|
||||
class MyModel(models.Model):
|
||||
DIRECTION_UP = 'U'
|
||||
DIRECTION_DOWN = 'D'
|
||||
DIRECTION_CHOICES = (
|
||||
DIRECTION_CHOICES = [
|
||||
(DIRECTION_UP, 'Up'),
|
||||
(DIRECTION_DOWN, 'Down'),
|
||||
)
|
||||
]
|
||||
|
||||
Use of ``django.conf.settings``
|
||||
===============================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue