[Django]-Is There A Built-in Way to Filter with Given Function in Django?

3👍

Django’s Postgres integration allows you to query in embedded arrays using the __contains operator. So you can do:

Route.objects.filter(stops_forwards__contains=[285])

See the ArrayField documentation.

Leave a comment