[sqlalchemy] Re: Strange occasional ProgrammingError: Cannot operate on a closed database

2011-04-26 Thread Kent Hsu
Thanks. It works after switching to NullPool. On 4月25日, 下午10時12分, Michael Bayer mike...@zzzcomputing.com wrote: the refresh 50 times aspect suggests it's concurrency-related.   SingletonThreadpool, the pool the SQLite dialect uses in 0.6, isn't the best choice for a file-based database so

[sqlalchemy] Re: Constructor and destructor of mapped objects

2011-04-26 Thread Gunnlaugur Briem
Hi Dmitry. You don't need to call the Base constructor, it's just a convenience feature: http://www.sqlalchemy.org/docs/orm/extensions/declarative.html#class-constructor For doing stuff on delete, check out the ORM event API, specifically the before_delete and after_delete events:

[sqlalchemy] Re: Best way to insert different string to Unicode columns?

2011-04-26 Thread Gunnlaugur Briem
Hi, the proper way is to handle character encoding yourself, and pass unicode objects to methods that expect them. When you get this SAWarning, you've just passed in a byte sequence (str in python 2.x) where a unicode object was expected. Your byte sequence *may* be an ASCII-encoded string

[sqlalchemy] Re: unicode everywhere

2011-04-26 Thread Gunnlaugur Briem
Hi Chris, Use Unicode/UnicodeText wherever you have text (and are able to know its character encoding at storage time, preferably always). Text and String are really just byte sequences, and should be used if it's arbitrary bytes you want to store. If you don't have control of the DB schema,

[sqlalchemy] Re: Constructor and destructor of mapped objects

2011-04-26 Thread Dmitry Guryanov
Thanks a lot, this is exactly what i was looking for ! -- Dmitry Guryanov -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to

[sqlalchemy] Re: Side by side versions on one machine.

2011-04-26 Thread GHZ
Try virtualenv http://pypi.python.org/pypi/virtualenv On Apr 26, 2:31 pm, Mathieu Tozer math...@madebysofa.com wrote: Is it possible to have multiple installation versions on the one machine? I don't want to screw with my dev environment too much but want to try migrating up. -- You

[sqlalchemy] Side by side versions on one machine.

2011-04-26 Thread Mathieu Tozer
Is it possible to have multiple installation versions on the one machine? I don't want to screw with my dev environment too much but want to try migrating up. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

Re: [sqlalchemy] Re: Side by side versions on one machine.

2011-04-26 Thread Mike Conley
If you only want to change the SQLAlchemy version and use easy install tools, I have done it by altering the sqlalchemy path in site_packages/easy-install.pth I find that easier than setting up virtual environments. If you need to change a lot of things including maybe the Python version, then

Re: [sqlalchemy] Re: Side by side versions on one machine.

2011-04-26 Thread werner
On 04/26/2011 03:24 PM, Mike Conley wrote: If you only want to change the SQLAlchemy version and use easy install tools, I have done it by altering the sqlalchemy path in site_packages/easy-install.pth Or do this before you import SQLAlchemy: I find that easier than setting up virtual

Re: [sqlalchemy] Re: Side by side versions on one machine.

2011-04-26 Thread werner
On 04/26/2011 03:24 PM, Mike Conley wrote: If you only want to change the SQLAlchemy version and use easy install tools, I have done it by altering the sqlalchemy path in site_packages/easy-install.pth Sorry clicked wrong button to fast Use the multi version install, e.g.: # MULTI or

Re: [sqlalchemy] ORM performance

2011-04-26 Thread Yang Zhang
On Wed, Apr 13, 2011 at 6:07 PM, Michael Bayer mike...@zzzcomputing.com wrote: To work around the instance arguments being baked in, create the query like this: query.filter(SomeClass.somerecord ==bindparam(somerecord)) The params are then added using query.params(somerecord=x). Is it

Re: [sqlalchemy] ORM performance

2011-04-26 Thread Yang Zhang
On Tue, Apr 26, 2011 at 12:32 PM, Yang Zhang yanghates...@gmail.com wrote: On Wed, Apr 13, 2011 at 6:07 PM, Michael Bayer mike...@zzzcomputing.com wrote: To work around the instance arguments being baked in, create the query like this: query.filter(SomeClass.somerecord