Review: Needs Fixing

Looks very nice, though perhaps we could improve the following details:

- a better name for the method, e.g. 'resolve_o2m_commands_to_record_dicts', 
inspired by niv's original method in addons, or something similar

- explicitly deal with commands that are not in [0,1,4], which would currently 
cause empty dicts in the result, or a ValueError when unpacking pairs and 
expecting triples. Perhaps the safest for now is to assert ``command in 
(0,1,4)``

- as vmt said offline, the ``yield`` is perhaps unnecessary, given that all the 
data is pre-fetched. It can make the reader look for something missing and 
explaining the need/reason for yielding.

Note: we could imagine a similar method for m2m, but this is sufficient for 
now, until the need arises in addons :-)
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-fix-o2m-in-contexts-xmo/+merge/78845
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-server/trunk-fix-o2m-in-contexts-xmo.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to