Re: [sqlalchemy] Which columns changing during orm commit?

2010-08-19 Thread Chris Withers
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?

[sqlalchemy] declarative base - can a relationship be used within a column_property?

2010-08-19 Thread Yap Sok Ann
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,

[sqlalchemy] Re: INSERT…RETURNING being issued wro ngly

2010-08-19 Thread Oliver Beattie
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

[sqlalchemy] upgrading code with prop.backref from 0.5 - 0.6

2010-08-19 Thread sandro dentella
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',

Re: [sqlalchemy] Which columns changing during orm commit?

2010-08-19 Thread Michael Hipp
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

[sqlalchemy] How do I set the transaction isolation level in SQLAlchemy for PostgreSQL?

2010-08-19 Thread Mahmoud Abdelkader
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.

[sqlalchemy] Model factory

2010-08-19 Thread Eduardo Robles Elvira
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.