[sqlalchemy] Result of a table.update()

2010-10-21 Thread Warwick Prince
Hi All I'm using 0.6.4 under Windoze with MySQL, Python 2.6.4 and I had code that I thought worked before (0.6.3) - which appeared to break due to this issue.. I could be wrong on this point so I'll just get to the crux of the matter... I have a result = table.update(whereClause,

[sqlalchemy] Attribute overriding in mixin inheritance hierarchy

2010-10-21 Thread oystein
Hi all, I am using declarative to model an existing object hierarchy where there is an abstract part that i model as an hierarchy of mixins and a concrete part where i use joined-table inheritance. I have a problem when there is attributes with the same name, one overriding the other, in the

Re: [sqlalchemy] Attribute overriding in mixin inheritance hierarchy

2010-10-21 Thread Michael Bayer
On Oct 21, 2010, at 2:39 PM, oystein wrote: Hi all, I am using declarative to model an existing object hierarchy where there is an abstract part that i model as an hierarchy of mixins and a concrete part where i use joined-table inheritance. I have a problem when there is attributes

Re: [sqlalchemy] Is it safe to use ORM alongside with the use of mysql queries?

2010-10-21 Thread Michael Bayer
there's no problem at all. If you are working with the ORM and SQL in one transaction, you might need to expire your objects to get a hold of the changes you issue via SQL, until you commit() the transaction which expires everything (or start a new session). On Oct 20, 2010, at 3:16 PM,

Re: [sqlalchemy] How to update TableRelations

2010-10-21 Thread Michael Bayer
On Oct 20, 2010, at 3:38 AM, Aydın ŞEN wrote: I defined my tables below as declarative class MyTable(Base): __tablename__ = 'mytable' id = Column(Integer,primary_key = True) title = Column(String(200)) description = Column(String(200)) dt_st = Column(Date,

Re: [sqlalchemy] dynamic load better choice than joinedload?

2010-10-21 Thread Michael Bayer
On Oct 20, 2010, at 5:54 PM, Alvaro Reinoso wrote: Hello, I'd like to know what the best choice is. This is what I do in my system: I'm using grok server and python on the server side; and javascript on the client side. I store all the user data in a session object and this data gets

Re: [sqlalchemy] Result of a table.update()

2010-10-21 Thread Michael Bayer
an UPDATE statement returns no rows unless RETURNING was used to return columns from those rows that were updated. When an UPDATE or DELETE is emitted, result.rowcount contains the number of rows that were matched by the statement's criterion. On Oct 21, 2010, at 2:06 AM, Warwick Prince

Re: [sqlalchemy] Result of a table.update()

2010-10-21 Thread Warwick Prince
HI Michael Thanks for the info. .rowcount was the missing link I needed. I'll also play with RETURNING as well as I thought I had tried that at one stage and saw no change in the SQL emitted, so moved on. I'll let you know. Cheers Warwick an UPDATE statement returns no rows unless

Re: [sqlalchemy] Attribute overriding in mixin inheritance hierarchy

2010-10-21 Thread Øystein Senneset Haaland
On Thursday 21. October 2010 22.58.35 Michael Bayer wrote: On Oct 21, 2010, at 2:39 PM, oystein wrote: Hi all, I am using declarative to model an existing object hierarchy where there is an abstract part that i model as an hierarchy of mixins and a concrete part where i use