私は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="..."/>
?