How did you get it working?
can you give an example please
On Thursday, March 17, 2016 at 6:44:42 AM UTC-7, Boncheff wrote:
>
> Thanks for your replies - it is now working as expected
>
> On Tuesday, 15 March 2016 16:50:58 UTC, Boncheff wrote:
>>
>> We have a DB model that contains a 'foo' field which is JSONType
>>
>> Inside this we store the following data:
>>
>> foo => [{"apps": ["test_app"]}, {"tags": ["test_tag1", "test_tag2"]}]
>>
>> My question is, how can I, using session.query, select all items that
>> have a *test_tag_1* as a tag inside the foo column?
>>
>> I tried*
>> session.query(MyModel).filter(MyModel.foo[0]['tags'].in_('test_tag1')).all()*
>>
>> but this results in
>>
>> *** NotImplementedError: Operator 'getitem' is not supported on this
>> expression
>>
>> Is what I am trying to achieve even possible?
>>
>
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
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 https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.