Trait django_query::filtering::Operable
source · [−]Expand description
A type that Django operators can work on.
Django queries have operators for simple values, like strings and
numbers, but this masks some complexity when nullable values and
collections are considered. An Operable
type is one that an
operator on simple values can be applied to.
All simple types that occur naturally in Django queries can be
made Operable
, but so can, for example, Vec and Option, when
their wrapped type is itself Operable
. It’s up to an Operable
implementation to decide how to take an operator on its base type
and apply it to its contents, for example by iterating over
whatever contents it has.
The implementations for Vec and Option match the default behaviour in Django.