-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compatible with django_model_utils Choices #78
Comments
Hi @dbinetti. Looking over the code, the choices field is just a regular What are you're trying to accomplish by using the human-readable value instead of the code value? Could you provide a concrete example? Using the human-readable value is generally problematic, as this is a display value subject to transformation (language translation, capitalization, etc...). The code values are more durable since they aren't transformed. |
I'm trying to make the URL human readable (and fungible directly). However, your point about transformation makes good sense. I'll let this go. |
I'd say your best bet is to use code values that are human friendly. eg, # Use:
STATUSES = (
('started', 'Started'),
('in_progress', 'In Progress'),
('finished', 'Finished'),
('errored', 'Errored'),
)
# instead of
STATUSES = (
('s', 'Started'),
('p', 'In Progress'),
('f', 'Finished'),
('e', 'Errored'),
) |
actually, i'm using integers (order is important) motel_utils allow for a tks On Wed, Mar 16, 2016 at 1:43 PM, Ryan P Kilby notifications@github.com
|
I am using @carljm's django_model_util Choices field. is this package compatible? i ask because i am trying to create a filter that uses the human-readable version of the choices field backing a model field, and can't get it to work. if it is compatible, i'd love a concrete example to follow. thanks...
The text was updated successfully, but these errors were encountered: