[sqlalchemy] Re: concurent modification

2007-12-20 Thread imgrey
> connection.execute("LOCK TABLE IN SHARE ROW EXCLUSIVE") I've managed to resolve this problem with replacing postgres with sqlite backend. Seems it is working about one week already. Thanks a lot. --~--~-~--~~~---~--~~ You received this message because you are s

[sqlalchemy] Re: Caching

2007-12-20 Thread Michael Bayer
On Dec 20, 2007, at 1:04 PM, Anton V. Belyaev wrote: > > And if an instance from cache has nothing for one of its deferred > column values, then referencing these properties after merge wont load > them from DB, but just fail? > I rearranged instance-level deferred loaders to be serializable

[sqlalchemy] Re: sqlalchemy object serialization / deserialization

2007-12-20 Thread Rick Morrison
Hey Matt. Class hinting was a json-rpc 1.0 feature, subsequently dropped in 1.1. But that's a nit. The real problem, though is reconstituing those hints -- the machinery for reinstantiating those objects has to come from somewhere, and that somewhere is going to your code -- there is no magic "ju

[sqlalchemy] Re: sqlalchemy object serialization / deserialization

2007-12-20 Thread Matt
On Dec 20, 5:04 pm, "Rick Morrison" <[EMAIL PROTECTED]> wrote: > You're not going to be able to serialize Python class instances in JSON: > json strings are simple object literals limited to basic Javascript types. > Pickle does some pretty heavy lifting to serialize and reconstitute class > insta

[sqlalchemy] Re: 0.4 deprecation warnings, what is the new get_by/select_by?

2007-12-20 Thread David Gardner
Maybe this could go into the FAQ? This post really helped me update some code using SA 0.3. Gaetan de Menten wrote: > On Dec 20, 2007 8:50 AM, iain duncan <[EMAIL PROTECTED]> wrote: > >> Sorry if this seems a stupid question, but I thought that Mike had said >> that in sa0.4, if you used sess

[sqlalchemy] Re: sqlalchemy object serialization / deserialization

2007-12-20 Thread Rick Morrison
You're not going to be able to serialize Python class instances in JSON: json strings are simple object literals limited to basic Javascript types. Pickle does some pretty heavy lifting to serialize and reconstitute class instances. Easiest way to store JSON in the database is to limit the type of

[sqlalchemy] sqlalchemy object serialization / deserialization

2007-12-20 Thread Matt
Hi all, I'm trying to implement simple object serialization (ala the pickle module) using JSON. I'm pretty far along, but having one problem -- serializing a sqlalchemy object through the __reduce__ method produces a circular reference through the InstanceState object. pprint of the structures

[sqlalchemy] Re: Conventions for creating SQL alchemy apps

2007-12-20 Thread Morgan
Thanks for that, make sense to me. svilen wrote: > some may-be-stupid answers: > - see the number of lines per file > - split it into app-field-related parts, not SA-arhitectural parts > - hell, do as it is easier - start as one file, once u hit some limit > of your nerve(r)s, split.. but do

[sqlalchemy] Re: Caching

2007-12-20 Thread Michael Bayer
On Dec 20, 2007, at 1:04 PM, Anton V. Belyaev wrote: > So, to be cached, an object should fetch all its deferred columns (if > any) and provide all of them at __getstate__. Right? that would work. > And if an instance from cache has nothing for one of its deferred > column values, then referen

[sqlalchemy] Re: Caching

2007-12-20 Thread Anton V. Belyaev
> pickle isnt going to work with deferred columns unless you implement > __getstate__ and __setstate__. so the issue with session.merge() is > just an extension of that issue, correct ? i.e. without deferreds > merge has no issue. > > is it not reasonable to ask that objects which are to be seri

[sqlalchemy] Re: Conventions for creating SQL alchemy apps

2007-12-20 Thread Rick Morrison
Agreed, it's easier to start with a single file, and then split from there as maintaining it becomes more difficult. You'll find the table defs and mappers, and mapped classes are pretty inter-related, and you'll drive yourself nuts if you have them in 20 different places. --~--~-~--~

[sqlalchemy] Re: Caching

2007-12-20 Thread Michael Bayer
pickle isnt going to work with deferred columns unless you implement __getstate__ and __setstate__. so the issue with session.merge() is just an extension of that issue, correct ? i.e. without deferreds merge has no issue. is it not reasonable to ask that objects which are to be serializ

[sqlalchemy] Re: query.filter_or() ?

2007-12-20 Thread svilen
On Thursday 20 December 2007 16:06:53 Rick Morrison wrote: > How would you specify the logical "parenthesis" to control > evaluation order in complex expressions? something like joinpoint? or maybe, a semi-explicit ".parethnesis()" of sorts... dunnow, but this is a thing that's missing; one has

[sqlalchemy] Re: 0.4 deprecation warnings, what is the new get_by/select_by?

2007-12-20 Thread iain duncan
On Thu, 2007-20-12 at 09:58 +0100, Gaetan de Menten wrote: > On Dec 20, 2007 8:50 AM, iain duncan <[EMAIL PROTECTED]> wrote: > > > > Sorry if this seems a stupid question, but I thought that Mike had said > > that in sa0.4, if you used session_context that this > > > > User.query.get_by(name='john

[sqlalchemy] Re: query.filter_or() ?

2007-12-20 Thread Rick Morrison
How would you specify the logical "parenthesis" to control evaluation order in complex expressions? On Dec 20, 2007 5:14 AM, svilen <[EMAIL PROTECTED]> wrote: > > query.filter() does criterion = criterion & new > why not having one that does criterion = criterion | new ? > its useful to have some

[sqlalchemy] query.filter_or() ?

2007-12-20 Thread svilen
query.filter() does criterion = criterion & new why not having one that does criterion = criterion | new ? its useful to have some query.this.that.filter.whatever.filter_or(...) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

[sqlalchemy] Re: Caching

2007-12-20 Thread Anton V. Belyaev
Mike, thanks for your reply. > what happens if you just leave "_state" alone ? there shouldnt be any > need to mess with _state (nor _entity_name). the only attribute > worth deleting for the cache operation is "_sa_session_id" so that the > instance isnt associated with any particular session

[sqlalchemy] Re: 0.4 deprecation warnings, what is the new get_by/select_by?

2007-12-20 Thread Gaetan de Menten
On Dec 20, 2007 8:50 AM, iain duncan <[EMAIL PROTECTED]> wrote: > > Sorry if this seems a stupid question, but I thought that Mike had said > that in sa0.4, if you used session_context that this > > User.query.get_by(name='john') > > was the replacement for the old assign mapper convenience call.

[sqlalchemy] Re: Conventions for creating SQL alchemy apps

2007-12-20 Thread svilen
some may-be-stupid answers: - see the number of lines per file - split it into app-field-related parts, not SA-arhitectural parts - hell, do as it is easier - start as one file, once u hit some limit of your nerve(r)s, split.. but do keep one single file as main entrance point On Thursday 20