diff options
| author | Nick Pope <nick@nickpope.me.uk> | 2021-03-23 10:07:43 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-03-24 07:45:33 +0100 |
| commit | 41e39c41c9225bc3cbd5f333694e0a4d113136be (patch) | |
| tree | a081eba04a533c2b6d4f8691f237f61afe869e89 /docs | |
| parent | 4894a97578dbb816f142535586b0d6154d94ac8e (diff) | |
Refs #32460 -- Doc'd and tested that property names of model choice enums cannot be used as members.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/fields.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index aedf115e08..e5332d4bfc 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -226,6 +226,11 @@ modifications: ``.choices``, ``.labels``, ``.values``, and ``.names`` -- to make it easier to access lists of those separate parts of the enumeration. Use ``.choices`` as a suitable value to pass to :attr:`~Field.choices` in a field definition. + + .. warning:: + + These property names cannot be used as member names as they would conflict. + * The use of :func:`enum.unique()` is enforced to ensure that values cannot be defined multiple times. This is unlikely to be expected in choices for a field. |
