Re: Issue with get_FOO_display not working in Django admin

2023-04-05 Thread David Sanders
At this point I'll let others chime in with their opinion on whether this is something that needs to change because: 1. I rarely use admin 2. I've never really had the need to override a choice's display over those supplied via `choices` :) On Wed, 5 Apr 2023 at 19:05, 'Ibrahim Abou Ele

Re: Issue with get_FOO_display not working in Django admin

2023-04-05 Thread 'Ibrahim Abou Elenein' via Django developers (Contributions to Django itself)
Isn't this some sort of duplication? why not just use it instead of writing its logic again? On Wednesday, April 5, 2023 at 7:12:48 AM UTC+2 David Sanders wrote: > Hi Ibrahim, > > get_FOO_display() isn't intended to be overridden like that, it's just a > convenience method for use in templates/w

Re: Issue with get_FOO_display not working in Django admin

2023-04-04 Thread David Sanders
Hi Ibrahim, get_FOO_display() isn't intended to be overridden like that, it's just a convenience method for use in templates/whatever that refers to the underlying flatchoices. For clarity, please see the documentation: https://docs.djangoproject.com/en/4.2/ref/models/instances/#django.db.models.

Issue with get_FOO_display not working in Django admin

2023-04-04 Thread 'Ibrahim Abou Elenein' via Django developers (Contributions to Django itself)
Dear All, I am writing to report an issue I encountered while working with Django admin. I had a model with a field that uses Choices as follows: ``` status = FSMField(default=STATUSES.PENDING, choices=STATUSES, protected=True) ``` I overrode the get_status_display method, but to my surprise, i