Skip to content

Commit

Permalink
feat: Generate wrapper fields
Browse files Browse the repository at this point in the history
  • Loading branch information
tefra committed Mar 21, 2024
1 parent 0c1d014 commit 65c0342
Show file tree
Hide file tree
Showing 31 changed files with 210 additions and 248 deletions.
27 changes: 12 additions & 15 deletions output/instances/ibmData/mixed/assertions/po_sample/po.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from output.models.ibm_data.mixed.assertions.po_sample.po_xsd.po import Buyer
from output.models.ibm_data.mixed.assertions.po_sample.po_xsd.po import Order
from output.models.ibm_data.mixed.assertions.po_sample.po_xsd.product import LongItemDefn
from output.models.ibm_data.mixed.assertions.po_sample.po_xsd.product import Poitems
from output.models.ibm_data.mixed.assertions.po_sample.po_xsd.product import ShortItemDefn


Expand All @@ -30,20 +29,18 @@

),
email='jimmy.nice@jimmy.org',
items=Poitems(
item=[
LongItemDefn(
quantity=1,
price=Decimal('88.10'),
description='Inside Java Virtual Machine: Sun Press (James Gosling)'
),
ShortItemDefn(
quantity=2,
price=Decimal('20'),
id='105'
),
]
),
item=[
LongItemDefn(
quantity=1,
price=Decimal('88.10'),
description='Inside Java Virtual Machine: Sun Press (James Gosling)'
),
ShortItemDefn(
quantity=2,
price=Decimal('20'),
id='105'
),
],
tax=Decimal('10.81'),
bill_amount=Decimal('118.91'),
currency='USD',
Expand Down
19 changes: 8 additions & 11 deletions output/instances/ibmData/mixed/targetNamespace/tns4.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
from output.models.ibm_data.mixed.target_namespace.tns4_xsd.tns4 import X
from output.models.ibm_data.mixed.target_namespace.tns4_xsd.tns4_imp import A
from output.models.ibm_data.mixed.target_namespace.tns4_xsd.tns4_imp import Y


obj = X(
y=Y(
a=[
A(
value=1
),
A(
value=2
),
]
)
a=[
A(
value=1
),
A(
value=2
),
]
)
26 changes: 12 additions & 14 deletions output/instances/msData/additional/test74834.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,16 @@
),
]
),
stringsection=Datafile.Stringsection(
string=[
'aqopkde#^90d',
'qpweipqweiaqopkde#^90d',
'aqopkde#^90asdaskdl;asd',
'aqopkdejgdlepsdf#^90d',
'aqopkde#^90kl;345l3;lkldf345d',
'alg;ldfqopkde34059-fld;#^90d',
'aqodfflkgd;flpkd%$e(*34534)$#%#^90d',
'aqopfskdjflknmvkde#^90d',
'sdfsdfsdaqopkde#^90d430985dflskjsdf',
'aqopdsflsd;lf0495-304kde#^90d',
]
)
string=[
'aqopkde#^90d',
'qpweipqweiaqopkde#^90d',
'aqopkde#^90asdaskdl;asd',
'aqopkdejgdlepsdf#^90d',
'aqopkde#^90kl;345l3;lkldf345d',
'alg;ldfqopkde34059-fld;#^90d',
'aqodfflkgd;flpkd%$e(*34534)$#%#^90d',
'aqopfskdjflknmvkde#^90d',
'sdfsdfsdaqopkde#^90d430985dflskjsdf',
'aqopdsflsd;lf0495-304kde#^90d',
]
)
65 changes: 13 additions & 52 deletions output/instances/msData/element/elemZ018.py
Original file line number Diff line number Diff line change
@@ -1,73 +1,34 @@
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Aaa
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Bbb
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Ccc
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Ddd
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Eee
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Fff
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Ggg
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Hhh
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Iii
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Jjj
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Kkk
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Lll
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Mmm
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Nnn
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Ooo
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Ppp
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Qqq
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Root
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Rrr
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Signatures
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Sss
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Ttt
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Uuu
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Www
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Xxx
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Yyy
from output.models.ms_data.element.elem_z018_xsd.elem_z018 import Zzz


obj = Root(
aaa=Aaa(
bbb=Bbb(
ccc=Ccc(
ddd=Ddd(
eee=Eee(
fff=Fff(
ggg=Ggg(
hhh=Hhh(
iii=Iii(
jjj=Jjj(
kkk=Kkk(
lll=Lll(
mmm=Mmm(
nnn=Nnn(
ooo=Ooo(
ppp=Ppp(
qqq=Qqq(
rrr=Rrr(
sss=Sss(
ttt=Ttt(
uuu=Uuu(
www=Www(
xxx=Xxx(
yyy=Yyy(
zzz=Zzz(
signatures=Signatures(
bbb=Bbb(
ddd=Ddd(
fff=Fff(
hhh=Hhh(
jjj=Jjj(
lll=Lll(
nnn=Nnn(
ppp=Ppp(
rrr=Rrr(
ttt=Ttt(
www=Www(
yyy=Yyy(
signatures=Signatures(

)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
Expand Down
7 changes: 2 additions & 5 deletions output/instances/msData/modelGroups/mgQ006.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from output.models.ms_data.model_groups.mg_q006_xsd.mg_q006 import Bar
from output.models.ms_data.model_groups.mg_q006_xsd.mg_q006 import Doc


obj = Doc(
e1='yo',
e2=Bar(
e1='This is different'
)
e1_element='yo',
e1='This is different'
)
7 changes: 2 additions & 5 deletions output/instances/msData/modelGroups/mgQ007.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from output.models.ms_data.model_groups.mg_q007_xsd.mg_q007 import Bar
from output.models.ms_data.model_groups.mg_q007_xsd.mg_q007 import Doc


obj = Doc(
e1='yo',
e2=Bar(
e1='This is different'
)
e1_element='yo',
e1='This is different'
)
7 changes: 2 additions & 5 deletions output/instances/msData/modelGroups/mgQ014.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from output.models.ms_data.model_groups.mg_q014_xsd.mg_q014 import Bar
from output.models.ms_data.model_groups.mg_q014_xsd.mg_q014 import Doc


obj = Doc(
e1='',
e2=Bar(
e1='This is different'
)
e1_element='',
e1='This is different'
)
7 changes: 2 additions & 5 deletions output/instances/msData/modelGroups/mgQ015.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from output.models.ms_data.model_groups.mg_q015_xsd.mg_q015 import Bar
from output.models.ms_data.model_groups.mg_q015_xsd.mg_q015 import Doc


obj = Doc(
e1='',
e2=Bar(
e1='This is different'
)
e1_element='',
e1='This is different'
)
7 changes: 2 additions & 5 deletions output/instances/msData/modelGroups/mgQ016.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from output.models.ms_data.model_groups.mg_q016_xsd.mg_q016 import Bar
from output.models.ms_data.model_groups.mg_q016_xsd.mg_q016 import Doc


obj = Doc(
e1='',
e2=Bar(
e1='This is different'
)
e1_element='',
e1='This is different'
)
7 changes: 2 additions & 5 deletions output/instances/msData/modelGroups/mgQ017.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from output.models.ms_data.model_groups.mg_q017_xsd.mg_q017 import Bar
from output.models.ms_data.model_groups.mg_q017_xsd.mg_q017 import Doc


obj = Doc(
e1='',
e2=Bar(
e1='This is different'
)
e1_element='',
e1='This is different'
)
13 changes: 5 additions & 8 deletions output/instances/msData/particles/particlesQ024.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
from output.models.ms_data.particles.particles_q024_xsd.particles_q024 import Doc
from output.models.ms_data.particles.particles_q024_xsd.particles_q024 import R


obj = Doc(
elem=R(
foo=[
'',
'',
'',
]
)
foo=[
'',
'',
'',
]
)
9 changes: 2 additions & 7 deletions output/instances/saxonData/Assert/assert022.v1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from output.models.saxon_data.assert_pkg.assert022_xsd.assert022 import D
from output.models.saxon_data.assert_pkg.assert022_xsd.assert022 import Doc
from output.models.saxon_data.assert_pkg.assert022_xsd.assert022 import Temp
from xsdata.models.datatype import XmlDate
Expand All @@ -7,14 +6,10 @@
obj = Doc(
temp=[
Temp(
event=D(
d=XmlDate(2008, 7, 1)
)
d=XmlDate(2008, 7, 1)
),
Temp(
event=D(
d=XmlDate(2010, 11, 17, 0)
)
d=XmlDate(2010, 11, 17, 0)
),
]
)
2 changes: 1 addition & 1 deletion output/instances/saxonData/Open/open001.v1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from output.models.saxon_data.open.open002_xsd.open002 import Doc
from output.models.saxon_data.open.open001_xsd.open001 import Doc
from xsdata.formats.dataclass.models.generics import AnyElement


Expand Down
2 changes: 1 addition & 1 deletion output/instances/saxonData/Open/open001.v2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from output.models.saxon_data.open.open002_xsd.open002 import Doc
from output.models.saxon_data.open.open001_xsd.open001 import Doc
from xsdata.formats.dataclass.models.generics import AnyElement


Expand Down
2 changes: 1 addition & 1 deletion output/instances/saxonData/Open/open001.v3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from output.models.saxon_data.open.open002_xsd.open002 import Doc
from output.models.saxon_data.open.open001_xsd.open001 import Doc


obj = Doc(
Expand Down
2 changes: 1 addition & 1 deletion output/instances/saxonData/VC/vc001.n1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from output.models.saxon_data.vc.vc024_xsd.vc024 import Temp
from output.models.saxon_data.vc.vc001_xsd.vc001 import Temp


obj = Temp(
Expand Down
10 changes: 5 additions & 5 deletions output/instances/saxonData/Wild/wild075.v1.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from output.models.saxon_data.wild.wild075_xsd.wild075 import B
from output.models.saxon_data.wild.wild075_xsd.wild075 import Root
from xsdata.models.datatype import XmlDate
from output.models.saxon_data.wild.wild076_xsd.wild076 import Root
from xsdata.formats.dataclass.models.generics import AnyElement


obj = Root(
a=23,
local_element=B(
value=XmlDate(2010, 10, 16)
local_element=AnyElement(
qname='b',
text='2010-10-16'
)
)
2 changes: 1 addition & 1 deletion output/instances/saxonData/Zone/zone101.v02.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from output.models.saxon_data.zone.zone101_xsd.zone101 import Doc
from output.models.saxon_data.zone.zone102_xsd.zone102 import Doc
from xsdata.models.datatype import XmlDateTime


Expand Down
11 changes: 7 additions & 4 deletions output/models/ibm_data/mixed/assertions/po_sample/po_xsd/po.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from typing import List, Optional, Type, Union

from output.models.ibm_data.mixed.assertions.po_sample.po_xsd.product import (
Poitems,
Item,
LongItemDefn,
ShortItemDefn,
)


Expand Down Expand Up @@ -189,12 +191,13 @@ class Meta:
"pattern": r".*@.*\..*",
},
)
items: Optional[Poitems] = field(
default=None,
item: List[Union[Item, ShortItemDefn, LongItemDefn]] = field(
default_factory=list,
metadata={
"wrapper": "items",
"type": "Element",
"namespace": "",
"required": True,
"min_occurs": 1,
},
)
tax: Optional[Decimal] = field(
Expand Down
Loading

0 comments on commit 65c0342

Please sign in to comment.