comparison src/backend.py @ 395:9bc3fbf3e685

backend: fixed elements filtering in parseItemConfig
author Goffi <goffi@goffi.org>
date Sat, 23 Feb 2019 20:59:41 +0100
parents dc83b1d837cf
children 562e7a01218d
comparison
equal deleted inserted replaced
394:dc83b1d837cf 395:9bc3fbf3e685
299 @return (tuple[unicode, dict)): (access_model, item_config) 299 @return (tuple[unicode, dict)): (access_model, item_config)
300 """ 300 """
301 item_config = None 301 item_config = None
302 access_model = const.VAL_AMODEL_DEFAULT 302 access_model = const.VAL_AMODEL_DEFAULT
303 for idx, elt in enumerate(item.elements()): 303 for idx, elt in enumerate(item.elements()):
304 if elt.uri != 'data_form.NS_X_DATA' or elt.name != 'x': 304 if elt.uri != data_form.NS_X_DATA or elt.name != 'x':
305 continue 305 continue
306 form = data_form.Form.fromElement(elt) 306 form = data_form.Form.fromElement(elt)
307 if form.formNamespace == const.NS_ITEM_CONFIG: 307 if form.formNamespace == const.NS_ITEM_CONFIG:
308 item_config = form 308 item_config = form
309 del item.children[idx] #we need to remove the config from item 309 del item.children[idx] #we need to remove the config from item