Skip to content

API Reference

Constants

py_rql.constants.FilterLookups

EQ = 'eq' class-attribute instance-attribute

Equal operator

GE = 'ge' class-attribute instance-attribute

Greater or equal operator

GT = 'gt' class-attribute instance-attribute

Greater than operator

IN = 'in' class-attribute instance-attribute

In operator

I_LIKE = 'ilike' class-attribute instance-attribute

Case-insensitive like operator

LE = 'le' class-attribute instance-attribute

Less or equal operator

LIKE = 'like' class-attribute instance-attribute

like operator

LT = 'lt' class-attribute instance-attribute

Less then operator

NE = 'ne' class-attribute instance-attribute

Not equal operator

NULL = 'null' class-attribute instance-attribute

null operator

OUT = 'out' class-attribute instance-attribute

Not in operator

boolean(with_null = True) classmethod

Returns the default lookups for boolean fields.

Args: with_null (bool): if true, includes the null lookup, defaults to True.

Returns:

Type Description
set

a set with the default lookups.

numeric(with_null: bool = True) -> set classmethod

Returns the default lookups for numeric fields.

Parameters:

Name Type Description Default
with_null bool

if true, includes the null lookup, defaults to True.

True

Returns:

Type Description
set

a set with the default lookups.

string(with_null = True) classmethod

Returns the default lookups for string fields.

Parameters:

Name Type Description Default
with_null bool

if true, includes the null lookup, defaults to True.

True

Returns:

Type Description
set

a set with the default lookups.

Exceptions

py_rql.exceptions.RQLFilterError(details = None)

Bases: Exception

Base class for RQL errors.

py_rql.exceptions.RQLFilterParsingError(**kwargs)

Bases: RQLFilterError

Parsing errors are raised only at query parsing time.

py_rql.exceptions.RQLFilterLookupError

Bases: RQLFilterError

Lookup error is raised when provided lookup is not supported by the associated filter.

py_rql.exceptions.RQLFilterValueError

Bases: RQLFilterError

Value error is raised when provided values can't be converted to DB field types.