obelisk.types.core.Comparison

class obelisk.types.core.Comparison(left: str, right: Any, op: str)[source]

Bases: object

Comparisons are the basic items of a Filter. They consist of a field name, operator, and possibly a value on the right.

It is strongly suggested you create comparisons by using the staticmethods on this class, rather than trying to construct them yourselves.

When serializing to RSQL format, each argument is single quoted as to accept any otherwise reserved characters, and serialised using str().

__init__(left: str, right: Any, op: str)[source]

Methods

__init__(left: str, right: Any, op: str)[source]
classmethod equal(left: str, right: Any) Comparison[source]
classmethod greater(left: str, right: Any) Comparison[source]
classmethod greater_equal(left: str, right: Any) Comparison[source]
classmethod is_in(left: str, right: Iterable[Any]) Comparison[source]
classmethod is_not_in(left: str, right: Iterable[Any]) Comparison[source]
classmethod less(left: str, right: Any) Comparison[source]
classmethod less_equal(left: str, right: Any) Comparison[source]
classmethod not_equal(left: str, right: Any) Comparison[source]
classmethod not_null(left: str) Comparison[source]
classmethod null(left: str) Comparison[source]

Attributes

left: str
right: Any
op: str