Add new helper methods to CommaSeparatedValuesField.

Review Request #14210 — Created Oct. 19, 2024 and submitted — Latest diff uploaded

Information

Djblets
release-5.x

Reviewers

CommaSeparatedValuesField now introduces two new methods to the parent
model owning the field:

  • get_<fieldname>_list()
  • get_<fieldname>_display()

These both return a version of the stored list using any display names
provided by the choices= passed to the field.

This field was largely written in order to replace
django-multiselectfield, which provided these methods. We lacked
these until now.

The module was also missing from the codebase docs. It's now added.

Unit tests pass.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Add new helper methods to CommaSeparatedValuesField.
`CommaSeparatedValuesField` now introduces two new methods to the parent model owning the field: * `get_<fieldname>_list()` * `get_<fieldname>_display()` These both return a version of the stored list using any display names provided by the `choices=` passed to the field. This field was largely written in order to replace `django-multiselectfield`, which provided these methods. We lacked these until now. The module was also missing from the codebase docs. It's now added.
e52696e3fe0f911241e43efd205c4ae90d2fcde7 Christian Hammond
djblets/db/fields/comma_separated_values_field.py
djblets/db/tests/test_comma_separated_values_field.py
docs/djblets/coderef/index.rst
Loading...