Support filtering with relation__in
using model instances
#1819
Labels
enhancement
New feature or request
relation__in
using model instances
#1819
Is your feature request related to a problem? Please describe.
In Django ORM, we can efficiently filter related objects using
relation__in
syntax, for exampleHowever, Tortoise ORM only supports
relation_id__in
, requiring us to extract IDs manually before filtering. This makes queries more verbose and less intuitive, especially when working with object instances rather than IDs.Describe the solution you'd like
Add support for
relation__in
filtering in Tortoise ORM, allowing direct filtering using model instances similar to Django's implementation. For example:Additional context
This feature would improve compatibility with Django ORM patterns.
The text was updated successfully, but these errors were encountered: