sphinxcontrib-django icon indicating copy to clipboard operation
sphinxcontrib-django copied to clipboard

Add display name to field choices

Open mfosterw opened this issue 1 year ago • 0 comments

Motivation

Right now when documenting a field with choices, the values of those choices are all that is included. This is frustrating because usually the display name of the choice documents what it means.

Proposed Solution

Add display names to choices documentation, i.e. change

f"* ``{key}``" if key != "" else "* ``''`` (Empty string)"
for key, value in field.choices[:choices_limit]

to

f"* ``{key}: {value}``" if key != "" else "* ``''`` (Empty string)"
for key, value in field.choices[:choices_limit]

in attributes.get_field_details (or something along those lines).

mfosterw avatar Feb 24 '24 04:02 mfosterw