Hi friends,
I've raised a ticket here:
https://code.djangoproject.com/ticket/30427#ticketHas an associated PR and all.
Looking for some experts in this area to eyeball and drop some thoughts/opinions, or even better, knowledge as to why we're doing things this way presently.
I feel Django does class inheritance wrong at the moment -- when building a Model, it refuses to staple on a class attribute if an ancestor/mixin has already defined that attribute (with a non-falsey value). One could call it reverse-MRO behaviour.
It looks like the intention in the past was to stop attributes or field definitions from stomping on methods defined against the same class that have the same name, but if anything, I'd rather have this raise a proper warning if it's problematic, or silently stomp if it's not. Having it not stomp results in some very unpythonic behaviour.
Have a read of my ticket/PR for further context.
Looking forward to getting this fixed, so I can bubble the fix up to django-model-utils, and then to my production code. ^.^
Cheers,
Jarek