inheritable-method-string (E8147)#
A field passes a method object instead of its name.
What it does#
Reports compute=, inverse= and search= given a method of the class
instead of the method name as a string.
Why is this bad?#
The field keeps a reference to this exact function, so a module that overrides the method in an inheriting class is ignored.
Example#
def _compute_total(self): ...
total = fields.Float(compute=_compute_total)
Use instead:
total = fields.Float(compute="_compute_total")