我正在玩attribute_of
spyne 2.10(很高兴它出来了)。让我们考虑以下模型:
class Product(ComplexModel):
id = complex.XmlAttribute(primitive.Uuid)
edition = primitive.Unicode
edition_id = complex.XmlAttribute(primitive.Uuid, attribute_of='edition')
这给出了如下结果:
<product id="00000000-0000-0000-0000-000000000000">
<edition edition_id="00000000-0000-0000-0000-000000000000">My edition</edition>
</product>
如何edition_id
为结果自定义名称<edition id="..."/>
?