equal
deleted
inserted
replaced
73 for rschema in eschema.subject_relations(): |
73 for rschema in eschema.subject_relations(): |
74 if rschema.final and rschema in stringdict: |
74 if rschema.final and rschema in stringdict: |
75 if rschema == 'eid': |
75 if rschema == 'eid': |
76 continue |
76 continue |
77 attrtype = eschema.destination(rschema) |
77 attrtype = eschema.destination(rschema) |
78 typeddict[rschema.type] = converters[attrtype](stringdict[rschema]) |
78 value = stringdict[rschema] |
|
79 if value is not None: |
|
80 value = converters[attrtype](value) |
|
81 typeddict[rschema.type] = value |
79 return typeddict |
82 return typeddict |
80 |
83 |
81 def rtype_role_rql(rtype, role): |
84 def rtype_role_rql(rtype, role): |
82 if role == 'object': |
85 if role == 'object': |
83 return 'Y %s X WHERE X eid %%(x)s' % rtype |
86 return 'Y %s X WHERE X eid %%(x)s' % rtype |
292 role = child.get('role') |
295 role = child.get('role') |
293 if role: |
296 if role: |
294 # relation |
297 # relation |
295 related = rels.setdefault(role, {}).setdefault(child.tag, []) |
298 related = rels.setdefault(role, {}).setdefault(child.tag, []) |
296 related += [ritem for ritem, _ in self.parser.parse_etree(child)] |
299 related += [ritem for ritem, _ in self.parser.parse_etree(child)] |
297 else: |
300 elif child.text: |
298 # attribute |
301 # attribute |
299 item[child.tag] = unicode(child.text) |
302 item[child.tag] = unicode(child.text) |
|
303 else: |
|
304 # None attribute (empty tag) |
|
305 item[child.tag] = None |
300 return item, rels |
306 return item, rels |
301 |
307 |
302 |
308 |
303 class CWEntityXMLActionCopy(Component): |
309 class CWEntityXMLActionCopy(Component): |
304 """implementation of cubicweb entity xml parser's'copy' action |
310 """implementation of cubicweb entity xml parser's'copy' action |