python-zeep
python-zeep copied to clipboard
Reserved words not mangled in type properties
We have a type that looks like
<complexType name="problemType">
<element name="from" type="token" />
<element name="to" type="token" />
</complexType>
This means that we have a type which we need to access as:
myObject # type: problemType
myObject.from
This is invalid syntax as from is a reserved word. Clearly having element names that might be reserved words is problematic, but I cannot change the service. I suggest that global reserved words be mangled when creating type properties, for example appending a "_".
@da1910 Did you manage to work around this limitation?
Found a solution. You can use kwargs to send the "from".
Example:
client.service.Thing(something='value',**{'from':'2020-01-01T00:00:00'})