Operator

Bases: Enum

An enumeration of possible operators for search filters.

Can be used for the op attribute of the SearchFilter class to specify the operator for the filter.

Attributes:
  • LT

    Represents the "less than" operator.

  • LTE

    Represents the "less than or equal to" operator.

  • EQ

    Represents the "equal to" operator.

  • NEQ

    Represents the "not equal to" operator.

  • GT

    Represents the "greater than" operator.

  • GTE

    Represents the "greater than or equal to" operator.

  • IN

    Represents the "in" operator for checking if a value is in a list.

  • NIN

    Represents the "not in" operator for checking if a value is not in a list.

  • LIKE

    Represents the "like" operator for pattern matching.

  • NLIKE

    Represents the "not like" operator for pattern matching.

  • ILIKE

    Represents the "case-insensitive like" operator for pattern matching.

  • NILIKE

    Represents the "case-insensitive not like" operator for pattern matching.

  • STARTSWITH

    Represents the "starts with" operator for pattern matching.

  • ISTARTSWITH

    Represents the "case-insensitive starts with" operator for pattern matching.

  • NSTARTSWITH

    Represents the "not starts with" operator for pattern matching.

  • NISTARTSWITH

    Represents the "case-insensitive not starts with" operator for pattern matching.

  • ENDSWITH

    Represents the "ends with" operator for pattern matching.

  • IENDSWITH

    Represents the "case-insensitive ends with" operator for pattern matching.

  • NENDSWITH

    Represents the "not ends with" operator for pattern matching.

  • NIENDSWITH

    Represents the "case-insensitive not ends with" operator for pattern matching.

  • CONTAINS

    Represents the "contains" operator for pattern matching.

  • ICONTAINS

    Represents the "case-insensitive contains" operator for pattern matching.

  • NCONTAINS

    Represents the "not contains" operator for pattern matching.

  • NICONTAINS

    Represents the "case-insensitive not contains" operator for pattern matching.

Source code in src/alpha/infra/models/search_filter.py
class Operator(Enum):
    """An enumeration of possible operators for search filters.

    Can be used for the `op` attribute of the `SearchFilter` class to specify
    the operator for the filter.

    Attributes
    ----------
    LT
        Represents the "less than" operator.
    LTE
        Represents the "less than or equal to" operator.
    EQ
        Represents the "equal to" operator.
    NEQ
        Represents the "not equal to" operator.
    GT
        Represents the "greater than" operator.
    GTE
        Represents the "greater than or equal to" operator.
    IN
        Represents the "in" operator for checking if a value is in a list.
    NIN
        Represents the "not in" operator for checking if a value is not in a
        list.
    LIKE
        Represents the "like" operator for pattern matching.
    NLIKE
        Represents the "not like" operator for pattern matching.
    ILIKE
        Represents the "case-insensitive like" operator for pattern matching.
    NILIKE
        Represents the "case-insensitive not like" operator for pattern
        matching.
    STARTSWITH
        Represents the "starts with" operator for pattern matching.
    ISTARTSWITH
        Represents the "case-insensitive starts with" operator for pattern
        matching.
    NSTARTSWITH
        Represents the "not starts with" operator for pattern matching.
    NISTARTSWITH
        Represents the "case-insensitive not starts with" operator for pattern
        matching.
    ENDSWITH
        Represents the "ends with" operator for pattern matching.
    IENDSWITH
        Represents the "case-insensitive ends with" operator for pattern
        matching.
    NENDSWITH
        Represents the "not ends with" operator for pattern matching.
    NIENDSWITH
        Represents the "case-insensitive not ends with" operator for pattern
        matching.
    CONTAINS
        Represents the "contains" operator for pattern matching.
    ICONTAINS
        Represents the "case-insensitive contains" operator for pattern
        matching.
    NCONTAINS
        Represents the "not contains" operator for pattern matching.
    NICONTAINS
        Represents the "case-insensitive not contains" operator for pattern
        matching.
    """

    LT = auto()
    LTE = auto()
    EQ = auto()
    NEQ = auto()
    GT = auto()
    GTE = auto()
    IN = auto()
    NIN = auto()
    LIKE = auto()
    NLIKE = auto()
    ILIKE = auto()
    NILIKE = auto()
    STARTSWITH = auto()
    ISTARTSWITH = auto()
    NSTARTSWITH = auto()
    NISTARTSWITH = auto()
    ENDSWITH = auto()
    IENDSWITH = auto()
    NENDSWITH = auto()
    NIENDSWITH = auto()
    CONTAINS = auto()
    ICONTAINS = auto()
    NCONTAINS = auto()
    NICONTAINS = auto()