Usually for this sort of stuff, I serialize the object's data into a JSON dict ( object columns to JSON dict, object relations to a dict, list of dicts, or reference to another object). ( Custom dump/load is needed to handle Timestamp, Floats, etc). You might be able to iterate over the data in YAML and not require custom encoding/decoding. When I need to treat the json data as objects, I'll load them into a custom dict class that will treat attributes as keys.
The downside of this is that you don't have all the SqlAlchemy relational stuff or any ancillary methods (though they can be bridged in with more work). The benefit though is that you can get a nearly 1:1 parity between the core needs without much more work. When using a "read only" context, you can flip between SqlAlchemy objects and dicts. If you need to use the SqlAlchemy model itself, you could load the column/relationship data into it manually. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
