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'] =
Could something be added to the docs then to elaborate on how the context
manager works in regards to how things are committed/rolledback ?
I just added comments to the existing
example (
http://docs.sqlalchemy.org/en/rel_0_8/orm/session.html?highlight=begin_nested#using-savepoint
)
sure
On Jul 18, 2013, at 12:00 PM, Jonathan Vanasco jvana...@gmail.com wrote:
Could something be added to the docs then to elaborate on how the context
manager works in regards to how things are committed/rolledback ?
I just added comments to the existing example (
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
HI All,
I'm working on my first SQL Alchemy project. I'm thinking I'm going to
define a commit method for all the objects I want persist, I'm thinking
something like:
def commit(self):
session = Session() #Session is a global sessionmaker
session.add(self)
Well,
session should be a global variable, but keep in mind that
everytime you call commit, you are recreating session.
2013/7/18 Victor Reichert vfr...@gmail.com:
HI All,
I'm working on my first SQL Alchemy project. I'm thinking I'm going to
define a commit method for all the objects I want
On Jul 18, 2013, at 6:52 PM, Victor Reichert vfr...@gmail.com wrote:
HI All,
I'm working on my first SQL Alchemy project. I'm thinking I'm going to
define a commit method for all the objects I want persist, I'm thinking
something like:
def commit(self):
session =
meaning that a single commit() should address all the objects that
are related to a particular operation.
i commited it to my mind. :)
2013/7/18 Michael Bayer mike...@zzzcomputing.com:
On Jul 18, 2013, at 6:52 PM, Victor Reichert vfr...@gmail.com wrote:
HI All,
I'm working on my first SQL