Michael Hipp wrote:
SQLAlchemy seems pretty smart about updating only the changed columns in
an orm object...
If I have an orm object. Something changes one of the columns. Just
before I commit() the session, is there a way to tell which columns will
be updated vs those that are unchanged?
With declarative base, is it possible to use a relationship within a
column_property? Here's some sample code to illustrate what I want to
achieve:
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import column_property,
Still not quite sure how this was going wrong exactly (I was setting
the attribute on the new object but it wasn't being passed along to
the values dictionary), but I've sorted it nonetheless.
Thanks for trying to help with my (extremely vague) request anyway.
On Aug 19, 12:07Â am, Michael Bayer
Hi,
Let's start with the simple example based on movie/director example
class Director(Base):
__tablename__ = 'director'
id = Column(Integer, primary_key=True)
last_name = Column(String(60), nullable=False)
movies = relation('Movie',
On 8/19/2010 5:24 AM, Chris Withers wrote:
Michael Hipp wrote:
SQLAlchemy seems pretty smart about updating only the changed columns
in an orm object...
If I have an orm object. Something changes one of the columns. Just
before I commit() the session, is there a way to tell which columns
will
NOTE: I originally posted this question to stack overflow,
http://stackoverflow.com/questions/3518863/how-do-i-set-the-transaction-isolation-level-in-sqlalchemy-for-postgresql,
but I haven't received an answer yet. If I find the answer here, I'll
send
it over to stackoverflow for thoroughness.
Hello everyone:
This is my first post in this mailing list/group. My question is
simple: is there some way to tell sqlalchemy which method should be
called to instance models? Now, some background:
I'm working in a project with plugins support. In the project core
I've got a Job class model.