diff options
Diffstat (limited to 'src/ee/xml')
-rw-r--r-- | src/ee/xml/types.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/ee/xml/types.py b/src/ee/xml/types.py index 35cd664..a1ab7ec 100644 --- a/src/ee/xml/types.py +++ b/src/ee/xml/types.py @@ -807,11 +807,12 @@ class PartDb(GeneratedsSuper): class Part(GeneratedsSuper): subclass = None superclass = None - def __init__(self, uri=None, part_type=None, references=None, distributor_info=None, facts=None, price_breaks=None, **kwargs_): + def __init__(self, uri=None, part_type=None, description=None, references=None, distributor_info=None, facts=None, price_breaks=None, **kwargs_): self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.uri = _cast(None, uri) self.part_type = part_type + self.description = description self.references = references self.distributor_info = distributor_info self.facts = facts @@ -832,6 +833,11 @@ class Part(GeneratedsSuper): def set_part_type(self, part_type): self.part_type = part_type part_typeProp = property(get_part_type, set_part_type) + def get_description(self): + return self.description + def set_description(self, description): + self.description = description + descriptionProp = property(get_description, set_description) def get_references(self): return self.references def set_references(self, references): @@ -860,6 +866,7 @@ class Part(GeneratedsSuper): def hasContent_(self): if ( self.part_type is not None or + self.description is not None or self.references is not None or self.distributor_info is not None or self.facts is not None or @@ -901,6 +908,9 @@ class Part(GeneratedsSuper): if self.part_type is not None: showIndent(outfile, level, pretty_print) outfile.write('<%spart-type>%s</%spart-type>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.part_type), input_name='part-type')), namespaceprefix_ , eol_)) + if self.description is not None: + showIndent(outfile, level, pretty_print) + outfile.write('<%sdescription>%s</%sdescription>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.description), input_name='description')), namespaceprefix_ , eol_)) if self.references is not None: self.references.export(outfile, level, namespaceprefix_, namespacedef_='', name_='references', pretty_print=pretty_print) if self.distributor_info is not None: @@ -926,6 +936,10 @@ class Part(GeneratedsSuper): part_type_ = child_.text part_type_ = self.gds_validate_string(part_type_, node, 'part_type') self.part_type = part_type_ + elif nodeName_ == 'description': + description_ = child_.text + description_ = self.gds_validate_string(description_, node, 'description') + self.description = description_ elif nodeName_ == 'references': obj_ = ReferencesList.factory(parent_object_=self) obj_.build(child_) |