0

I'm playing with attribute_of and spyne 2.10 (very glad it's out). Let's consider following model:

class Product(ComplexModel):
    id = complex.XmlAttribute(primitive.Uuid)
    edition = primitive.Unicode
    edition_id = complex.XmlAttribute(primitive.Uuid, attribute_of='edition')

That gives results like:

<product id="00000000-0000-0000-0000-000000000000">
    <edition edition_id="00000000-0000-0000-0000-000000000000">My edition</edition>
</product>

How to customize edition_id's name for results like <edition id="..."/>?

kbec
  • 3,415
  • 3
  • 27
  • 42

1 Answers1

1

As of 2.10, Spyne does not support this.

I can't think of an easy workaround as it'd require writing method_call and method_return_document events as well as wsdl events to patch the wsdl manually.

However, if you can write tests for it, I'll see what I can do for the 2.11.

Burak Arslan
  • 7,671
  • 2
  • 15
  • 24
  • Hi, please have a look at https://github.com/plq/spyne/blob/72665943092378a6d49460e21adeb95845dd4de5/examples/xml_utils.py#L78 and tell me what you think. – Burak Arslan May 19 '13 at 13:38