Closed spudfkc closed 8 years ago
Unfortunately, at this time the AlchemyManager.retrieve_list
only supports simple queries. So it's not really possible. My recommendation would be to extend the manager. (Though that method should be broken up into pieces to make it easier...)
I'm looking to use the sqlalchemymanager to retrieve a list of resources, but I want to add a filter to only retrieve resources that have a property that is in a list of given properties - I am unsure how to do this.
In sqlalchemy, I would do a
MyUserClass.query.filter(MyUserClass.id.in_(some_collection))
, but I see that alchemymanager.retrieve_list usesfilter_by
(which, IIRC, does not support the "in" clause). see: https://github.com/vertical-knowledge/ripozo-sqlalchemy/blob/master/ripozo_sqlalchemy/alchemymanager.py#L194What is the recommended way of filtering a list here?