[sqlalchemy] Re: Deprecation of the objects argument to session.flush()

2009-08-23 Thread Alexander Lebedev
Great thanks for the answer. But if these object are already in my session? For example, I create a query, get some related objects from the query. Then the user modifies all objects, but he decides to save only one object, while remaining objects must be changed (user may decide to save this

[sqlalchemy] Re: Deprecation of the objects argument to session.flush()

2009-08-23 Thread Michael Bayer
On Aug 23, 2009, at 4:03 AM, Alexander Lebedev wrote: Great thanks for the answer. But if these object are already in my session? For example, I create a query, get some related objects from the query. Then the user modifies all objects, but he decides to save only one object, while

[sqlalchemy] how to use mysqls SQL_CALC_FOUND_ROWS or how to know what number of rows a query would return.

2009-08-23 Thread robert rottermann
Hi there, I would like to create a batching functionality for a web based aplication that uses a mysql database. mysql offeres SQL_CALC_FOUND_ROWS for this purpose. how can I use it, or is there a generic way to have sqlalchemy return the number of rows a query would have returned without

[sqlalchemy] Re: how to use mysqls SQL_CALC_FOUND_ROWS or how to know what number of rows a query would return.

2009-08-23 Thread Michael Bayer
use the prefixes argument to select() for this. On Aug 23, 2009, at 4:23 PM, robert rottermann wrote: Hi there, I would like to create a batching functionality for a web based aplication that uses a mysql database. mysql offeres SQL_CALC_FOUND_ROWS for this purpose. how can I use

[sqlalchemy] Re: Deprecation of the objects argument to session.flush()

2009-08-23 Thread Alexander Lebedev
Hi, Michael! Thanks for so detail answer. My project is a Windows application, it works with sqlite database. So, no concurrent transaction may appear. I guess, the two session solution is the best for me. Solution with a distinct Session for each window seems me unwieldy as the solution with

[sqlalchemy] Possible to define composite mapping separate from underlying class implementation?

2009-08-23 Thread hal_robertson
Hello I am working with a legacy database and application design. I'm running into trouble mapping composite objects, as there is a common class that is persisted in different manners across many composite tables. I'm hoping to illustrate this problem with some Python code (below). I respect