[sqlalchemy] MapperOptions...

2010-07-01 Thread Chris Withers
...I think I may want to use session.query(...).options(...) to work with the versioning stuff I'm working on to express queries along the lines of: - tell me what the state of play was at 2pm yesterday - give me back new revisions of all objects between 2pm and 4pm yesterday - give me one

Re: [sqlalchemy] doing stuff in MapperExtension's before_insert and before_update

2010-07-01 Thread Chris Withers
Michael Bayer wrote: The recursion overflow is fixed and make_transient now removes expiration flags. In the latest tip you can now say: session.expire(object, ['id']) make_transient(object) or alternatively: make_transient(object) object.id = None and the

[sqlalchemy] mappers and non_primary arg

2010-07-01 Thread sandro dentella
Hi, I'm trying to use non_primary arg of function 'mapper'. Currently I have a GUI widget to browse/edit tables that is based on introspection of the mapper. My goal would be to reuse all the machinary of table browsing even when browsing tables tat where built w/o primary key. I'm ready to

[sqlalchemy] models in different packages, often declaratively defined

2010-07-01 Thread Chris Withers
Hi All, Suppose I have packageA that defines: from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class User(Base) __tablename__ = 'user' ... Now, I have a packageB that defines: from sqlalchemy.ext.declarative import declarative_base Base =

[sqlalchemy] Blob streaming

2010-07-01 Thread Samuel GARCIA
Hi list, I am new user of sqlalchemy. I play with python and MySQL for several years now and I discover sqlalchemy 1 year ago, it change my life. So thank you for this fantastic work. I develop a project of analysing big experimental dataset of intra/extra cellular recordings :

Re: [sqlalchemy] Blob streaming

2010-07-01 Thread Michael Bayer
On Jul 1, 2010, at 4:35 AM, Samuel GARCIA wrote: Hi list, I am new user of sqlalchemy. I play with python and MySQL for several years now and I discover sqlalchemy 1 year ago, it change my life. So thank you for this fantastic work. I develop a project of analysing big experimental

[sqlalchemy] Column order with declarative base

2010-07-01 Thread Mike Lewis
I'm trying to do some DDL creation with declarative base. THe problem I am running into is that I'm using a mixin, and it seems that the order the columns are being created in is different than the order they're declared with. Is there any way to control this? Thanks, Mike Lewis -- You

Re: [sqlalchemy] Column order with declarative base

2010-07-01 Thread Chris Withers
Mike Lewis wrote: I'm trying to do some DDL creation with declarative base. THe problem I am running into is that I'm using a mixin, and it seems that the order the columns are being created in is different than the order they're declared with. Is there any way to control this? Please

[sqlalchemy] Re: Column order with declarative base

2010-07-01 Thread Mike Lewis
Please provide a simple, small example of your problem :-) Also, is there a reason the order of column creation matters? Chris -- Simplistix - Content Management, Batch Processing Python Consulting             -http://www.simplistix.co.uk class Foo(object): id = Column(Integer,

Re: [sqlalchemy] Re: Column order with declarative base

2010-07-01 Thread Michael Bayer
On Jul 1, 2010, at 6:35 PM, Mike Lewis wrote: Please provide a simple, small example of your problem :-) Also, is there a reason the order of column creation matters? Chris -- Simplistix - Content Management, Batch Processing Python Consulting

Re: [sqlalchemy] Re: Column order with declarative base

2010-07-01 Thread Michael Bayer
On Jul 1, 2010, at 8:24 PM, Michael Bayer wrote: The Column object contains a sort key when constructed, against a single global value, that is used as a sort key when the Table is generated. This is to get around the fact that the attribute dictionary of the declarative class is

[sqlalchemy] ObjectDeletedError on orm.Query.delete

2010-07-01 Thread Yang Zhang
We're getting a strange ObjectDeletedError that we've been trying to debug for a large part of the day. The problem occurs when we keep a (hard) reference to an ORM object, drop_all, create_all, then delete() on a query over that ORM class (using the same scoped_session). Unfortunately, just the

Re: [sqlalchemy] ObjectDeletedError on orm.Query.delete

2010-07-01 Thread Michael Bayer
On Jul 1, 2010, at 9:40 PM, Yang Zhang wrote: We're getting a strange ObjectDeletedError that we've been trying to debug for a large part of the day. The problem occurs when we keep a (hard) reference to an ORM object, drop_all, create_all, then delete() on a query over that ORM class (using