python - How to make a complexType that extends a simpleType -
i have implement service spyne exposes specific wsdl
right i'm unable replicate definition:
<xs:complextype name="mytype"> <xs:simplecontent> <xs:extension base="xs:string"> <xs:attribute name="version" type="xs:string"/> </xs:extension> </xs:simplecontent> </xs:complextype>
so far best able achieve
class mytype(complexmodel): __namespace__ = "uri:my-ns" __extends__ = primitive.unicode version = xmlattribute(primitive.unicode)
that raise attributeerror
if "patch" models/complex.py
[1] obtain:
<xs:complextype name="mytype"> <xs:complexcontent> <xs:extension base="xs:string"> <xs:attribute name="version " type="xs:string"/> </xs:extension> </xs:complexcontent> </xs:complextype>
almost there! complextype has complexcontent
instead of simplecontent
[1] i'm using master branch of spyne (0f587b2d606b54e41fc5cc3d33b51cc3b324a2ca) , if add __extends__ = primitive.unicode
need change line 602 of model/complex.py
from:
if eattr._subclasses none
to
if getattr(eattr, "_subclasses", none) none
Comments
Post a Comment