diff options
| author | Donald Stufft <donald@stufft.io> | 2013-05-18 11:31:16 -0400 |
|---|---|---|
| committer | Donald Stufft <donald@stufft.io> | 2013-05-18 11:31:16 -0400 |
| commit | 398841d6d3fce45b21bdfcd8385889098079f84a (patch) | |
| tree | 570b586cdb0de1871a28ccd429b7b5a765e7df23 /docs | |
| parent | 78de9b19027d3aee268797ad8899ac7283024c0c (diff) | |
| parent | a19e9d80ffa10f8da43addcaa4ddd440beee8a4d (diff) | |
Merge branch 'allow-any-iterable-for-choices'
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/fields.txt | 7 | ||||
| -rw-r--r-- | docs/releases/1.6.txt | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index da5fe9bf60..6cf235c637 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -80,9 +80,10 @@ If a field has ``blank=False``, the field will be required. .. attribute:: Field.choices -An iterable (e.g., a list or tuple) of 2-tuples to use as choices for this -field. If this is given, the default form widget will be a select box with -these choices instead of the standard text field. +An iterable (e.g., a list or tuple) consisting itself of iterables of exactly +two items (e.g. ``[(A, B), (A, B) ...]``) to use as choices for this field. If +this is given, the default form widget will be a select box with these choices +instead of the standard text field. The first element in each tuple is the actual value to be stored, and the second element is the human-readable name. For example:: diff --git a/docs/releases/1.6.txt b/docs/releases/1.6.txt index 452baf7f76..ef79e5770c 100644 --- a/docs/releases/1.6.txt +++ b/docs/releases/1.6.txt @@ -238,6 +238,9 @@ Minor features Meta option: ``localized_fields``. Fields included in this list will be localized (by setting ``localize`` on the form field). +* The ``choices`` argument to model fields now accepts an iterable of iterables + instead of requiring an iterable of lists or tuples. + Backwards incompatible changes in 1.6 ===================================== |
