On Nov 6, 2008, at 12:28 AM, Adam Ryan wrote:

>
>
> Thanks a lot for the reply...
>
>> So to suggest an alternative to this you'd have to describe what
>> additional behavior is needed, such as is it an issue of overly
>> complex filter criterion being inefficient on the server side, or
>> you're trying to reduce the number of persist operations, or some  
>> kind
>> of long-transaction-spanning concern.
>
> I'm working on a web application so I suppose the later is of concern.
>
> Specifically, once the server has responded, I no longer have a handle
> on the SQLA session or query objects (they've been removed/deleted).
> But, I do have a beaker session, so I guess my question is how to best
> recreate a user's last result set so as to perform the user's current
> manipulation on it.
>
> I can't store the query object in the beaker session because it can't
> be pickled, right?.  So is there a way to dump a string representation
> of a query object, then recreate it and associate it with a new SQLA
> Session?
>
> Or am I missing the obvious?  Thanks again for the help.

ah, that says a lot.   At first I was thinking that Query is not hard  
to pickle other than the Session attached to it, which can be  
detached.  But it seems like the mappers associated with it would need  
some work too so that they restore themselves from the mapper  
registry.  Expression objects are pickleable - so you should be able  
to pickle just query._criterion and get that back.  But, I was just  
trying this out in 0.5 and there are some roadblocks even to that  
related to some ORM-level decorating that's going on with expressions  
(which aren't in 0.4), so I will get back to you.  the Query should  
have a straightforward path to being serialized.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to