Hi Jeff,
On 7 May 2010 20:51, Jeff Ortel <jortel(a)redhat.com> wrote:
> Ok, that may be a bug then (or more weirdness in the WSDL). We
have an
> element like<address /> in the response and it's coming back as
"".
> When it's set (so we
get<address><street>...</street>...</address>),
> it comes back as the correct complex data structure.
I'll check on this.
I'm more confident that it works this way for the builtin (xs) types I
mentioned then the complex types.
Thanks!
>> This is uglier but safer:
>>
>> key = 'middlename'
>> if key in response:
>> session[key] = response[key]
>> else:
>> session[key] = None
>
> Ah, I didn't realise it supported __getitem__ as well as __getattr__.
> Does it also support .get()?
No, sorry. Although rare, I didn't want to hide a real <get/> attribute.
Yeah, makes sense.
To be honest, I think it'd have been better to choose either attribute
or dict notation. Having both is confusing and leads to divergent
practices and documentation. Zope 2 made that mistake with various
things (like request keys) and it was never a good idea.
Martin