On Aug 14, 2007, at 1:37 PM, Koen Bok wrote:

>
> For our app we'd like the user to construct and save search queries
> that we execute on the database. My first thought was to construct
> something like:
>
> predicate = and_(or_(item.c.id>5, item.c.id<3),
> item.c.name.like('aap')))
>
> And save this to a pickle column in the database. But it gives:


ugh !  there is a specific feature, added in 0.4, that would prevent  
this from being convenient if youre using mappers.  since we thought,  
why would anyone want to save a SQL construct ? :)  it basically will  
try to execute the expression in the next INSERT or UPDATE clause.   
youd have to pre-pickle before attaching.

im not sure how youre getting a "module" error in 0.3; pickling of  
metadata/table objects should work as of the most recent 0.3 release  
(but not earlier 0.3 releases).

but in 0.4 the expression currently is housing operators as functions  
attached to a class.  so ive just added ticket #735 to move those  
functions to the module level.



--~--~---------~--~----~------------~-------~--~----~
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