Hi Stefan,

I undertook the work of bringing your branch up-to-date with mine. So far so good: https://github.com/plq/spyne/tree/to_string_reorg

I changed your update to ValidationError as it broke backwards compatibility and updated the rest of the code accordingly.

I also re-read spyne.protocol._model comparing it with my spyne.model.primitive in order not to miss any update done after you moved the functions out and reflected a few changes to your branch.

I have a suggestion: You might remember this concern of yours regarding the Option 1 that we're working on:

Cons: Harder to follow the code when you don't have the
{to,from}_string function in there respective classes.

Maybe we should make prot.to_string call cls.to_string for SimpleModel (and ModelBase) to make it easier to implement user-defined types, instead of blindly calling str(value). This will address your concern above and make it possible to implement custom types without overriding __str__ in the native type. What do you think?

We can also move DateTime.default_parse and Date.default_parse calls to spyne.protocol.soap. That's the only place where those calls are used anyway. This will let you throw ValidationError from those functions as well.

Now as for your original questions:

On 10/29/12 21:08, Stefan Andersson wrote:
model/complex.py in ComplexModelBase
to_dict ->   get_members_pairs ->   v.to_string

Let's move the to_dict logic ProtocolBase as well.

xml_schema/model.py in Tget_range_restriction_tag calls cls.to_string
and from what I can see ProtocolBase is not available XmlSchema.



Just call to_string from own ProtocolBase: a265c5f

We can merge as soon as the test suite is happy: https://travis-ci.org/plq/spyne/builds/3225525 I don't think it's as bad as it looks :)

Best,
Burak


_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap

Reply via email to