On May 21, 9:37 am, Michael Bayer <[EMAIL PROTECTED]> wrote:
> in_ is supported for column-based attributes. If you are getting
> NotImplemented, that's beacuse "time_series" is referencing either a
> collection or a many-to-one object reference. so SQL "IN" wouldn't
> work here. For the many-to-one case, "IN" could be implemented in
> SQLA easily if the referenced object had a single-column primary key,
> but for a composite primary key we dont yet support the (x, y, z) IN
> ((a,b,c), (d,e,f)) syntax (not sure of DB support for that either).
Excellent. Thanks very much. I am using a single column key, so it
sounds like I could also make the key explicit, so will try something
like:
.filter(Measurement.time_series.id.in_([getattr(ts, 'id') for ts in
time_series]).
I may give that a go at some point because it seems more natural to me
that the "or" approach (which I may not understand completely) (for
now it's working via an explicit accumulation in a loop over the time
series members).
Cheers,
Andrew
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---