First page Back Continue Last page Image

Parser Dict Method

<object>

<name>Bag</name>

<product-reference>bg-12314</reference>

</object>

lxml

parser_dict = {

'object' : ('object', True),

'product-reference' : ('reference', False),

'name' : ('title', False)}

XML Returned by the plugin

IntegrationSite_getPortalTypeParserDict

kw = {

reference : bg-1234,

title : Bag }

Parameters give to create an ERP5 object

indicate that this tag is the root of a new element


Notes:

Parser dict methods are used to transform XML returned by web service into a dict which is used by ERP5 to create brains objects which simulates an ERP5 object. As name of tags used by a web service can be different, a mapping between this tags and ERP5 object properties has to be done. This is achieved thanks to the Target Parser Interface available in the lxml lib.