[sqlalchemy] Re: query.filter and entity_name

2008-07-10 Thread Christophe de VIENNE
Thank you Michael, I will use subclassing instead. A mention of this technique in the documentation (in the Multiple Mappers for One Class) would be great, as it is the place I was looking for a solution to my problem when I found entity_name. Best regards, Christophe 2008/7/7 Michael Bayer

[sqlalchemy] Re: Connecting to MySQL

2008-07-10 Thread Lukasz Szybalski
On Thu, Jul 10, 2008 at 8:20 AM, Heston James [EMAIL PROTECTED] wrote: Good afternoon guys, I'm brand new to SQLAlchemy as of about 2 minutes ago, I have a couple of starter questions that I wanted to run past you, with any luck they'll be simple for you to answer. After looking through

[sqlalchemy] Re: Connecting to MySQL

2008-07-10 Thread Rick Morrison
Session.add is a version 0.5 method, you're maybe running 0.4.6? In the 0.4.x series, it's going to be: Session.save() for objects that are to be newly added to the session Session.update() for objects that are already in the session, or Session.save_or_update() to have the library figure it out

[sqlalchemy] Re: sAsync in complex project

2008-07-10 Thread Don Dwiggins
zipito wrote: Good day community. I don't know whether it is a good place to asc. Probably as good as any. You might try on the Twisted mailing list (or newsgroup gmane.comp.python.twisted) as well. Happy hunting, -- Don Dwiggins Advanced Publishing Technology

[sqlalchemy] Re: Connecting to MySQL

2008-07-10 Thread Heston James - Cold Beans
Session.add is a version 0.5 method, you're maybe running 0.4.6? In the 0.4.x series, it's going to be: Session.save() for objects that are to be newly added to the session Session.update() for objects that are already in the session, or Session.save_or_update() to have the library figure

[sqlalchemy] Re: Connecting to MySQL

2008-07-10 Thread Rick Morrison
That's exactly what the problem was :-) Is there any reason I should avoid using 0.5? I'm running python 2.4 at the moment, are they compatible? 0.5 is still in beta, and I don't have much experience with it myself, but if were just starting out, I would probably be using that, otherwise

[sqlalchemy] Re: Connecting to MySQL

2008-07-10 Thread jason kirtland
Lukasz Szybalski wrote: On Thu, Jul 10, 2008 at 11:26 AM, Heston James - Cold Beans [EMAIL PROTECTED] wrote: Session.add is a version 0.5 method, you're maybe running 0.4.6? In the 0.4.x series, it's going to be: Session.save() for objects that are to be newly added to the session

[sqlalchemy] propLoader comparisons

2008-07-10 Thread az
hi i got that the only allowed non-relational expressions over a reference (PropLoader) are: someklas.propname == instance and that would be translated into someklas.table.c.primarykey == instance.primarykey is there a way to apply same thing for =/= i.e. le/ge? (without resorting to

[sqlalchemy] Re: propLoader comparisons

2008-07-10 Thread Michael Bayer
before mappers are compiled, you pull out comparator_factory from your relation(), and set it to be some class of your own which subclasses PropComparator and implements __le__()/__gt__() . It wouldn't be hard to add comparator_factory as a keyword argument to relation() either. On

[sqlalchemy] mysql innodb table insert problem

2008-07-10 Thread lilo
I have set mysql tables to be innodb by default. Data inserted using sqlalchemy models never written to mysql innodb talbe. Innodb table is empty. If I try to insert data into the myisam tables, all the data get written to those tables. Here is the log of sqlalchemy insertion on innodb

[sqlalchemy] sqlalchemy connection pooling and mysql last_insert_id()

2008-07-10 Thread lilo
According my mysql, LAST_INSERT_ID() is connection specific, so there is no problem from race conditions. If I insert a record into a autoincremented table and do last_insert_id() on it, would there be a possibility where another insert happen just before selecting last_insert_id(). This won't

[sqlalchemy] Re: Connecting to MySQL

2008-07-10 Thread Lukasz Szybalski
On Thu, Jul 10, 2008 at 11:59 AM, jason kirtland [EMAIL PROTECTED] wrote: Lukasz Szybalski wrote: On Thu, Jul 10, 2008 at 11:26 AM, Heston James - Cold Beans [EMAIL PROTECTED] wrote: Session.add is a version 0.5 method, you're maybe running 0.4.6? In the 0.4.x series, it's going to be: