def clear_from_fields(item, fields, is_subobject=False):
 for elems in fields:
  if elems[0].startswith('*'):
   continue
  if is_subobject:
   val = elems[2]
  else:
   val = elems[1]
  if isinstance(val, basestring):
   if val.startswith('SETTINGS:'):
    setkey = val.split(':')[(-1)]
    val = getattr(item.settings, setkey)
  setattr(item, elems[0], val)
 if (item.COLLECTION_TYPE == 'system'):
  item.interfaces = {}

def clear_from_fields ( item , fields , is_subobject = False ) : for elems in fields : if elems [ 0 ] . startswith ( '*' ) : continue if is_subobject : val = elems [ 2 ] else : val = elems [ 1 ] if isinstance ( val , basestring ) : if val . startswith ( 'SETTINGS:' ) : setkey = val . split ( ':' ) [ ( - 1 ) ] val = getattr ( item . settings , setkey ) setattr ( item , elems [ 0 ] , val ) if ( item . COLLECTION_TYPE == 'system' ) : item . interfaces = { }
used by various item_* .