From aced0b1ad671b99b5fa393522b14701e12fe61e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 26 Jan 2013 15:10:22 +0100 Subject: [PATCH] Fix doc of Function.getter for AR review641002 --- doc/ref/models/fields.rst | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/doc/ref/models/fields.rst b/doc/ref/models/fields.rst index 42c5e6cc2e..be9b64d328 100644 --- a/doc/ref/models/fields.rst +++ b/doc/ref/models/fields.rst @@ -570,21 +570,34 @@ A function field can emulate any other given `field`. .. attribute:: Function.getter - The name of the classmethod of the :class:`~trytond.model.Model` for - getting values. - The signature of the method is:: + The name of the classmethod or instance of the + :class:`~trytond.model.Model` for getting values. + The signature of the classmethod is:: - getter(ids, name) + getter(instances, name) where `name` is the name of the field, and it must return a dictionary with - a value for each ids. + a value for each instance. - Or the signature of the method is:: + The signature of the instancemethod is:: - getter(ids, names) + getter(name) + + where `name` is the name of the field, and it must return the value. + + Or the signature of the classmethod is:: + + getter(instances, names) where `names` is a list of name fields, and it must return a dictionary - containing for each names a dictionary with a value for each ids. + containing for each names a dictionary with a value for each instance. + + the signature of the instancemethod is:: + + getter(names) + + where `names` is a list of name fields, and it must return a dictionary + containing for each names the value. :class:`Function` has some extra optional arguments: