diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2019-05-15 05:31:42 -0700 |
|---|---|---|
| committer | Carlton Gibson <carlton.gibson@noumenal.es> | 2019-05-15 14:41:01 +0200 |
| commit | 08c8838727310094c240d129060314027b7585e7 (patch) | |
| tree | c5ed44954592c1628862f553908d9788f74c3b13 /docs/internals/contributing/writing-code | |
| parent | f6febbc078aed627ec937f7e56876dc208a5e339 (diff) | |
[2.2.x] Changed tuple choices to list in docs.
Backport of 97d3321e89c8d4434927bdbc308db1ccffa99d3b from master
Diffstat (limited to 'docs/internals/contributing/writing-code')
| -rw-r--r-- | docs/internals/contributing/writing-code/coding-style.txt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/internals/contributing/writing-code/coding-style.txt b/docs/internals/contributing/writing-code/coding-style.txt index 67602b87da..fc516859bc 100644 --- a/docs/internals/contributing/writing-code/coding-style.txt +++ b/docs/internals/contributing/writing-code/coding-style.txt @@ -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`` =============================== |
