Operators

The following table lists the available operators and their semantics:

Operator (equivalent)

Semantics

=, !=, <>

The first one is for an exact match, the second one is for not equal, and the last one is the deprecated notation of not equal.

in, not in

This checks whether the value is one of the values named in a list in the right operand. It is given as a Python list: [('uid', 'in', [1, 2, 3])] or [('uid', 'not in', [1, 2, 3])].

<, <=

Greater than, greater or equal.

>, >=

Less than, less or equal.

like, not like

Checks whether the right operand is contained (substring) in the value.

ilike, not ilike

The same as the preceding one, but case-insensitive.

=like, =ilike

You can search for patterns here: % matches any string and _ matches one character. This is the equivalent of PostgreSQL's like.

child_of

For models with a parent_id field, this searches for children of the right operand. The right operand is included in the results.

=?

Evaluates to true if the right operand is false; otherwise, it behaves like "=". This is useful when you generate domains programmatically and want to filter by a value if one is set, but ignore the value otherwise.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset