tortoise / tortoise-orm

Familiar asyncio ORM for python, built with relations in mind
https://tortoise.github.io
Apache License 2.0
4.63k stars 385 forks source link

filtering JSONField by child elements #457

Open basilisk01 opened 4 years ago

basilisk01 commented 4 years ago

The example here only shows filtering by an exact match: https://github.com/tortoise/tortoise-orm/blob/2a4a77fed39f316c61803f928cb68046ac17f07e/examples/postgres.py#L39

Is there a way to filter based on a child key of the JSON, like in Django? https://django.programmingpedia.net/en/tutorial/1759/jsonfield---a-postgresql-specific-field#querying-data-nested-in-dictionaries

thanks

long2ice commented 4 years ago

You can watch https://github.com/tortoise/tortoise-orm/pull/451 for more detail.