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?
>

-- 
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.

Reply via email to