2013-04-24 3 views
0

나는 attribute_of 및 spyne 2.10 (매우 기쁘다)으로 놀고있다. 의는 다음과 같은 모델을 생각해 보자attribute_of의 이름 사용자 정의

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

어떻게 <edition id="..."/> 같은 결과를 edition_id의 이름을 사용자 정의하려면 다음과 같은 결과를 얻을 수

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

를?

답변

1

2.10부터 Spyne는이 기능을 지원하지 않습니다.

wsdl을 수동으로 패치하려면 wsdl 이벤트뿐만 아니라 method_call 및 method_return_document 이벤트를 작성해야하므로 쉽게 해결할 수 없습니다.

그러나 테스트를 작성할 수 있다면 2.11에서 수행 할 수있는 작업을 확인할 수 있습니다.

+0

나는 다음 주에 이것에 시간을 할애 할 것이다. 감사. – kbec

+0

안녕하세요, https://github.com/plq/spyne/blob/72665943092378a6d49460e21adeb95845dd4de5/examples/xml_utils.py#L78에서 어떻게 생각하는지 말해주세요. –