The missing '_and' was it. Thanks!
The reason why I am loathe to use between() (which I am doing in the
interim) is that I have a generalized query structure to which I pass ad
hoc elements based on user selection. If I can somehow deal with
dynamically constructing the arguments for the between operator
(specifically the 'and_' operator; the columns are easy) then this will
keep my desired structure. Otherwise, I am stuck with use of a conditional
to evaluate if between() is being selected.
Greg--
On Friday, April 10, 2015 at 9:55:29 PM UTC-5, Michael Bayer wrote:
>
>
>
> On 4/10/15 10:23 PM, Horcle wrote:
>
> I really dig use of the column operator for constructing queries, but have
> been unsuccessful with using this when the argument is "between." I read
> somewhere that Column.op(var) when var = "in_" does not work, so I would
> assume that this is true with "between."
>
>
>
> between is a three-op, that is, it is "x BETWEEN a AND b". op() isn't
> built with that in mind but you can always chain, such as:
>
> >>> print column('x').op('BETWEEN')(and_(column('a'), column('b')))
> x BETWEEN a AND b
>
>
> depends on what you want to do really (why not just use between() ?)
>
>
>
> Am I doing something wrong, or is this an expected behavior? If so, is
> there a more general way to deal with evaluating all passed column
> operators so that I don't have to have separate conditions for the between
> and in operators?
>
> Thanks in advance!
>
> Greg--
>
> --
> Greg M. Silverman
> Senior Developer Analyst
> Cardiovascular Informatics <http://www.med.umn.edu/cardiology/>
> University of Minnesota
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected]
> <javascript:>.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.