#30931: Cannot override get_FOO_display() in Django 2.2+. -------------------------------------+------------------------------------- Reporter: Jim Ouwerkerk | Owner: Carlton Type: | Gibson Cleanup/optimization | Status: assigned Component: Documentation | Version: 2.2 Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by Carlton Gibson): Hi Sergey, No. That's exactly the "implementing that just reverses the pass/fail behaviour depending on order..." — two test cases, one with the override declared before the field, one after, the one fails as it is, the other fails if you put that guard in... — That's on 2.1, but it's the underlying issue being exposed: the right approach is overriding `_get_FIELD_display()`. (Rather than us trying to patch something into `Field...`.) [https://github.com/django/django/pull/11999 PR] -- Ticket URL: <https://code.djangoproject.com/ticket/30931#comment:9> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.835a738bea3522fc0e002f2c1fe9e463%40djangoproject.com.