the most straightforward way is to use an event:
from sqlalchemy.schema import Table
from sqlalchemy import event
@event.listens_for(Table, column_reflect)
def set_utc_date(inspector, table, column_info):
if isinstance(column_info['type'], DateTime):
column_info['type'] =
That works! Thank you, Michael.
On Thu, Jul 18, 2013 at 7:02 AM, Michael Bayer mike...@zzzcomputing.comwrote:
the most straightforward way is to use an event:
from sqlalchemy.schema import Table
from sqlalchemy import event
@event.listens_for(Table, column_reflect)
def
How can I make all datetime columns to use my UTCDateTime type by default?
from sqlalchemy import types
from pytz import utc
Base = declarative_base()
class UTCDateTime(types.TypeDecorator):
impl = types.DateTime
def process_bind_param(self, value, engine):
if value is not