se adiciona field.Function
FossilOrigin-Name: 45a288bc30ad9b25fed59cd01c89bd2f7632926083384a7853c3b753a4d7f95b
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from .attribute import Attribute
|
||||
from .many2one import Many2One
|
||||
from .model import Model
|
||||
from .function import Function
|
||||
|
||||
__all__ = [Attribute, Many2One, Model]
|
||||
|
||||
@@ -19,3 +19,9 @@ class Field:
|
||||
if name not in namespaces:
|
||||
raise KeyError("namespace %s not found" % (name))
|
||||
inst._namespace_prefix = name
|
||||
|
||||
def _call(self, inst, method, *args):
|
||||
call = getattr(inst, method or '', None)
|
||||
|
||||
if callable(call):
|
||||
return call(*args)
|
||||
|
||||
Reference in New Issue
Block a user