django-shop
django-shop copied to clipboard
Overriding decimalfield_kwargs on BaseOrder model has no effect
Changing the decimalfield_kwargs in subclass has no effect after the model has been materialized. I had this issue before and till django 1.7 was easy to override the field attributes of the superclass with a decorator or other python appropriate methods.
There is also this django ticket opened for the very same issue.
I'm stumbled into this issue and the only good exit I'm seeing now is to remove the decimal fields from superclass and add them into subclass.
Any other approaches?
oh, haven't been aware of this. Well then we should move the decimalfield_kwargs
into shop/settings.py
, so that it becomes overridable.
Do you have a better name for it?
That will not solve the issue, because once the model becomes concrete, the field descriptors are not being overwritten even the arguments are changed.
What if we remove the decimal fields from shop models and explicitly ask to be added on subclassed models with desired properties?
but if we can override those decimalfield_kwargs
through settings.py
, what's the point of making them overridable?