Search code examples
pythonpython-2.7soapspyne

how to use attribute names like a:b in python spyne?


I am trying to change the attribute names, what I have is

class table(ComplexModel):
diffgr=XmlAttribute(String)
rowOrder=XmlAttribute(String)

can I change diffgr to diffgr:id?

as the scheme I am referring to has

<Table diffgr:id="Table1" msdata:rowOrder="0">

I am really stuck, any help?


Solution

  • Found the solution , in

    diffgr:id

    diffgr is a namespace

    hence in order to define a sub namepace, Considering my example, it should be

    id =XmlAttribute(String(sub_ns='diffgr'))