diff options
| author | Donald Stufft <donald@stufft.io> | 2013-05-17 15:31:41 -0400 |
|---|---|---|
| committer | Donald Stufft <donald@stufft.io> | 2013-05-18 11:14:05 -0400 |
| commit | a19e9d80ffa10f8da43addcaa4ddd440beee8a4d (patch) | |
| tree | 6c405ce14256de50c1e4a394514a6daaa0410e50 /docs/ref | |
| parent | a0c0cc924e4c6ffd22158f254ed9bc9556f05cc4 (diff) | |
Fixed #20430 - Enable iterable of iterables for model choices
Allows for any iterable, not just lists or tuples, to be used as
the inner item for a list of choices in a model.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/models/fields.txt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index 99ba78cb09..38b6459909 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:: |
