#16176: Overwriting a property with field during model inheritance.
-------------------------------------+-------------------------------------
Reporter: czepiel.artur@… | Owner:
Type: Bug | Thomas_Moronez
Component: Database layer | Status: assigned
(models, ORM) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by carljm):
I don't think the proposed error-reraising is a good idea. For one thing,
we can't be sure that the `AttributeError` is in fact due to a property
from an abstract base class, it could be due to a definition of
`__setattr__`, a metaclass, or possibly other even more diabolical things.
For another, when we can avoid it it's a bad idea to obscure the original
traceback by catching one exception and raising another one in its place.
melinath's suggestion to set all fields as class attributes so they
override descriptors from a parent class is certainly worth considering,
as it would make models behave more like regular Python classes. This
could result in some backwards-incompatibility; would need to look into it
more to get a clearer sense of what cases might cause trouble, but I think
it's probably acceptable if documented in the release notes.
--
Ticket URL: <https://code.djangoproject.com/ticket/16176#comment:6>
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 [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.