[sqlalchemy] Re: Quick way to deep copy an object?

2016-03-26 Thread Rudolf Cardinal
> > > Whoops - occasionally a session autoflush can break the function above - a > better version delays the session.add() calls until the relationships have > been built: from sqlalchemy.inspection import inspect from sqlalchemy.orm import class_mapper import logging log = logging.getLogger(_

[sqlalchemy] Re: Quick way to deep copy an object?

2016-03-25 Thread Rudolf Cardinal
My method is as follows; for an SQLAlchemy ORM object x, call: y = deepcopy_sqla_object(x, session), with functions defined as below. It walks relationships (as defined by each ORM class; if there is no "relationship" then it won't proceed, which can be helpful), copying objects, and then rebui

[sqlalchemy] Re: Is it possible to use a Comparator to override a database/SQL-side comparison symmetrically?

2016-02-09 Thread Rudolf Cardinal
Dear Mike, Thank you very much! That makes sense; good to know. all the best, Rudolf. -- 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 sqlalchemy+unsubscr...@goog

[sqlalchemy] Is it possible to use a Comparator to override a database/SQL-side comparison symmetrically?

2016-02-08 Thread Rudolf Cardinal
Dear all, I've been trying to implement a datetime-style field in SQL Alchemy that, in the database backend, uses a specific ISO-8601 format (e.g. " 2013-04-30T00:26:03.000+05:00"), and is a datetime at the Python end. The primary database engine is MySQL. I don't want to implement this as a