soap request includes a hyphenated field, don't know how to set it
straycat000 at yahoo.com
straycat000 at yahoo.com
Fri Mar 27 04:22:55 EDT 2009
On Mar 27, 1:15 am, Justin Ezequiel <justin.mailingli... at gmail.com>
wrote:
> On Mar 27, 3:33 pm, straycat... at yahoo.com wrote:
>
>
>
> > Working my way through suds, I have something like this:
>
> > >>> event = client.factory.create('ns0:UserVerifiedEvent')
> > >>> print event
>
> > (UserVerifiedEvent){
> > event-id = None
> > user-verified-content[] = <empty>
> > domain-specific-attributes =
> > (MediaAttributes){
> > domain-attribute[] = <empty>
> > }
> > }
> > >>> event.event-id = "164-251340-2009-03-12"
>
> > SyntaxError: can't assign to operator
>
> > Any ideas or python magic to get around this hyphen problem (and I
> > can't change that to event_id or the server won't recognize it.)
>
> > Thanks,
> > Matthew
>
> haven't tried suds but perhaps you can try
>
> setattr(event, "event-id", "164-251340-2009-03-12")
That did it!
Thanks!
Matthew
More information about the Python-list
mailing list