#31124: Model.get_FOO_display() does not work correctly with inherited choices.
-------------------------------------+-------------------------------------
     Reporter:  Yash Jhunjhunwala    |                    Owner:  George
                                     |  Popides
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  3.0
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by zeynel):

 Replying to [comment:10 George Popides]:
 > Why would checking on fields class be a bad idea?
 > If you are a field of a model that is not abstract but your parent is an
 abstract method, wouldn't you want to override your parent's method if you
 both have the same method?

 Well it is not something I would prefer because it makes two classes
 tightly coupled to each other, which means it is hard to change one
 without touching to the other one and you always need to think about side
 effects of your change. Which eventually makes this two classes hard to
 test and makes the codebase hard to maintain.

 Your logic about overriding might/or might not be true. I would just
 execute this logic on `ModelBase` rather than `Field`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31124#comment:11>
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/061.8a25fd767ff89745e1902a1c77233865%40djangoproject.com.

Reply via email to