Context: I’ve created a mixin in which I define a new Function field, and I register this mixin using register_mixin, specifying the Model class in classinfo.
However, the field is not being created in any model. On the other hand, if I define a method in the mixin, that method is added to the models.
Is the fact that register_mixin doesn’t allow fields to be created is it intentional?
Yes because __register__
is not called when the mixin is applied but it is on purpose. This is because if you create such field to any model, it is no more possible to create accurate translations for example.
The Mixin registration exists only to alter existing “stuffs”.