i have similar thing, but by keeping an expression in my own terms and 
rendering into different things, like text, SQL, SA-expresion, etc.
u define what is a variable, const, functor, overload all the 
operators, etc etc; then have a visitor that walks and translates 
(interprets) it into whatever one needs.

see the generic one
http://dbcook.svn.sourceforge.net/viewvc/dbcook/trunk/dbcook/utik/expr.py
and the above-into-SA-translator (automaticaly doing other stuff)
http://dbcook.svn.sourceforge.net/viewvc/dbcook/trunk/dbcook/expression.py

ciao
svil

On Wednesday 01 April 2009 21:18:23 Hinrich Winther wrote:
> Maybe there is a better way of doing it. To be exact:
>
> I want to disassemble a given _BinaryExpression into basic elements
> (a list of strings, arrays, integers ...) and reassemble it
> somewhere else out of this basic elements.
>
> On 01.04.2009, at 18:14, Michael Bayer wrote:
> > Hinrich Winther wrote:
> >> Hi,
> >>
> >> I need to generate a sqlalchemy.sql.expression._BinaryExpression
> >> by hand. So I looked into the docu and found that I need a left,
> >> right and a operator. I am stuck at the left :) type() says it
> >> is a sqlalchemy.sql.util.AnnotatedColumn. But I can't find the
> >> class definition anywhere in sqlalchemy. Where is it defined?
> >
> > if you just say column('foo') == column('bar') (column is
> > sqlalchemy.sql.column), you've got a _BinaryExpression.   there
> > shouldn't
> > be a need to access _BinaryExpression directly.
> >

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to