Commit f2f9ab79 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[xsd gen] Minor cleanups

parent 9b9d3b927264
...@@ -192,12 +192,12 @@ class SEDA2XSDExport(EntityAdapter): ...@@ -192,12 +192,12 @@ class SEDA2XSDExport(EntityAdapter):
content_type = self.xsd_content_type(xselement.textual_content_type) content_type = self.xsd_content_type(xselement.textual_content_type)
attrs['type'] = content_type attrs['type'] = content_type
target_element = self.element('xsd:attribute', parent, attrs) target_element = self.element('xsd:attribute', parent, attrs)
target_value = xsd_serialize(target_value) value = xsd_serialize(target_value)
if target_value is not None: if value is not None:
if xselement.local_name == 'id': if xselement.local_name == 'id':
target_element.attrib[self.qname('seda:profid')] = target_value target_element.attrib[self.qname('seda:profid')] = value
else: else:
target_element.attrib['fixed'] = target_value target_element.attrib['fixed'] = value
def element_xmlelement(self, occ, profile_element, target_value, to_process, card_entity): # noqa def element_xmlelement(self, occ, profile_element, target_value, to_process, card_entity): # noqa
attrs = xsd_element_cardinality(occ, card_entity) attrs = xsd_element_cardinality(occ, card_entity)
...@@ -345,7 +345,7 @@ def xsd_serialize(value): ...@@ -345,7 +345,7 @@ def xsd_serialize(value):
# value is something in the profile which has a id # value is something in the profile which has a id
return value.id return value.id
if hasattr(value, 'eid'): if hasattr(value, 'eid'):
return None # XXX return None # intermediary entity
if isinstance(value, bool): if isinstance(value, bool):
return 'true' if value else 'false' return 'true' if value else 'false'
if isinstance(value, (date, datetime)): if isinstance(value, (date, datetime)):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment