Skip to content

Commit

Permalink
Merge pull request #114 from gisce/fix_b07_attr_tag
Browse files Browse the repository at this point in the history
FIX - Add TpAttr tag to XML
  • Loading branch information
tinogis authored Sep 26, 2024
2 parents e1d5f4c + d1c5c21 commit cbb33d0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions primestg/order/orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,9 @@ def __init__(self, generic_values, payload):
for tppro in tppros:
attrs = tppro.pop('TpAttr')
tppro_xml = B07TpPro(tppro)
for k, v in attrs.items():
tpattr_xml = B07TpAttr(k, v)
tppro_xml.tpattr.append(tpattr_xml)

tpattr_xml = B07TpAttr(attrs)
tppro_xml.tpattr.append(tpattr_xml)

task_xml.tppro.append(tppro_xml)
b07.tasks.append(task_xml)
Expand Down Expand Up @@ -434,8 +434,11 @@ def __init__(self, task, drop_empty=False):


class B07TpAttr(XmlModel):
def __init__(self, key, value, drop_empty=False):
self.tpattr = XmlField(key, value=value)
def __init__(self, values, drop_empty=False):
self.tpattr = XmlField('TpAttr')
for k, v in values.items():
setattr(self, k, XmlField(k, value=v, parent='TpAttr'))

super(B07TpAttr, self).__init__('TpAttr', 'tpattr', drop_empty=drop_empty)

class B09:
Expand Down

0 comments on commit cbb33d0

Please sign in to comment.