what u want to accomplish? looks like u need one of the .any(..) or .has(..), check those also. or do u need a plain join?
On Wednesday 21 May 2008 07:50, andrew cooke wrote: > Hi, > > Just wanted to check: I am seeing a NotImplementedError (v 0.4.6 on > Linux w Python 2.5) when I try to query some objects with the filter > "in". Does that mean that the feature is not implemented, or is it > more likely an error in my code (eg somehow I'm calling a base class; > "Address.email_address.in_" does appear in the ORM tutorial, which > makes me wonder whether it is supported)? > > If this is unsupported, what's the best approach? Just loop over the > various instances myself? > > My code looks like: > > query = session.query(Measurement) > query = query.filter(Measurement.time_series.in_(time_series)) > > where Measurement is a mapped class, and time_series is both a list of > TimeSeries instances (another mapped class) and a Measurement > attribute that is mapped via a relation. If it's relevant - > Measurement is actually a base class for joined table inheritance (the > time series key col is in the base class table). > > The trace looks like: > File "/home/andrew/projects/isti/kpi-pilot-2/repository-tool/src/ > isti/reptool/core/actions/readonly.py", line 96, in _no_undo > Measurement.time_series.in_(time_series)) > File "/usr/lib64/python2.5/site-packages/sqlalchemy/sql/ > expression.py", line 1220, in in_ > return self.operate(operators.in_op, other) > File "/usr/lib64/python2.5/site-packages/sqlalchemy/orm/ > attributes.py", line 56, in operate > return op(self.comparator, *other, **kwargs) > File "/usr/lib64/python2.5/site-packages/sqlalchemy/sql/ > operators.py", line 47, in in_op > return a.in_(*b) > File "/usr/lib64/python2.5/site-packages/sqlalchemy/sql/ > expression.py", line 1220, in in_ > return self.operate(operators.in_op, other) > File "/usr/lib64/python2.5/site-packages/sqlalchemy/sql/ > expression.py", line 1181, in operate > raise NotImplementedError() > NotImplementedError > > Finally, thanks for this library - it's an excellent piece of > software. The first ORM/SQL lib that I've felt really works well. > > Cheers, > Andrew > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
