Changed tuple choices to list in docs.

This commit is contained in:
Jon Dufresne 2019-05-15 05:31:42 -07:00 committed by Carlton Gibson
parent 717362d810
commit 97d3321e89
8 changed files with 27 additions and 27 deletions

View file

@ -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``
===============================