[sqlalchemy] Re: threadlocal sessions and transactions

2008-07-20 Thread Michael Bayer
On Jul 19, 2008, at 9:10 AM, Contact 42 wrote: Hi, I am using sa 0.5b2 under python 2.5. Should the following code commit myobj. engine = create_engine(appconfig.dburi, strategy='threadlocal') Session = scoped_session(sessionmaker(bind=engine, autoflush=True, autocommit=True)) sess

[sqlalchemy] Re: Boolean, Declerative, MySQL 5.2

2008-07-20 Thread Bobby Impollonia
I am using Column(Boolean) with declarative and MySQL and it is working fine. In MySQL itself the type is 'tinyint(1)' but they provide 'bool' and 'boolean' as synonyms if you prefer. On Sat, Jul 19, 2008 at 7:48 AM, Heston James - Cold Beans [EMAIL PROTECTED] wrote: Hello Guys, I'm looking

[sqlalchemy] Column metadata from mapped class

2008-07-20 Thread Sean Davis
I have been playing with 0.5 and have a very simple question. If I have a mapped class, User, how can I get at the columns of User? I see lots of constructs like User.c, but User has no 'c' attribute now. I am looking at finding the column types, names (to loop over), etc. Thanks, Sean

[sqlalchemy] Re: Column metadata from mapped class

2008-07-20 Thread Michael Bayer
On Jul 20, 2008, at 7:48 AM, Sean Davis wrote: I have been playing with 0.5 and have a very simple question. If I have a mapped class, User, how can I get at the columns of User? I see lots of constructs like User.c, but User has no 'c' attribute now. I am looking at finding the

[sqlalchemy] Modelling a complex(ish) many-to-many association with dates

2008-07-20 Thread Rob Cowie
I have a many-to-many relationship between 'Company' and 'Index', defined in an association table (CompanyIndex). Schemas below: Company: (companyID, companyName, ...) Index: (indexID, indexName) CompanyIndex: (companyID, indexID, eventDate, eventType) Would like to

[sqlalchemy] Re: Overriding table columns with Python-property

2008-07-20 Thread Michael Bayer
On Jul 19, 2008, at 7:39 AM, Malthe Borch wrote: I tried adapting your example, which admittedly works :-), to a scenario that better resembles mine, but now the property is overriden simply, even when I use ``exclude_properties``. Note that the setup is overly complex, but this should

[sqlalchemy] Re: Modelling a complex(ish) many-to-many association with dates

2008-07-20 Thread Michael Bayer
On Jul 20, 2008, at 1:22 PM, Rob Cowie wrote: I have a many-to-many relationship between 'Company' and 'Index', defined in an association table (CompanyIndex). Schemas below: Company: (companyID, companyName, ...) Index: (indexID, indexName) CompanyIndex:

[sqlalchemy] Re: Modelling a complex(ish) many-to-many association with dates

2008-07-20 Thread Rob Cowie
On reflection, I didn't pose the problem very clearly. What I mean with regard to appending or removing index objects is that the collection returned by company.indices(date) would - on append of an index object - record the association by creating an IndexAssociation object (mapped to the

[sqlalchemy] Re: Modelling a complex(ish) many-to-many association with dates

2008-07-20 Thread Michael Bayer
On Jul 20, 2008, at 2:24 PM, Rob Cowie wrote: On reflection, I didn't pose the problem very clearly. What I mean with regard to appending or removing index objects is that the collection returned by company.indices(date) would - on append of an index object - record the association by

[sqlalchemy] Re: Overriding table columns with Python-property

2008-07-20 Thread Malthe Borch
Michael Bayer wrote: well, i can support this in 0.5 trunk. in rev 4965, If a descriptor is present on a class, or if the name is excluded via the include/ exclude lists, the attribute will not be instrumented via the inherited mapper or via the mapped Table. So your example works with

[sqlalchemy] Re: Overriding table columns with Python-property

2008-07-20 Thread Michael Bayer
On Jul 19, 2008, at 7:39 AM, Malthe Borch wrote: I tried adapting your example, which admittedly works :-), to a scenario that better resembles mine, but now the property is overriden simply, even when I use ``exclude_properties``. Note that the setup is overly complex, but this should