Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les fondamentaux
Voir le programme détaillé
Module « sqlalchemy »

Classe « ColumnOperators »

Informations générales

Héritage

builtins.object
    Operators
        ColumnOperators

Définition

class ColumnOperators(Operators):

help(ColumnOperators)

Defines boolean, comparison, and other operators for
:class:`_expression.ColumnElement` expressions.

By default, all methods call down to
:meth:`.operate` or :meth:`.reverse_operate`,
passing in the appropriate operator function from the
Python builtin ``operator`` module or
a SQLAlchemy-specific operator function from
:mod:`sqlalchemy.expression.operators`.   For example
the ``__eq__`` function::

    def __eq__(self, other):
        return self.operate(operators.eq, other)

Where ``operators.eq`` is essentially::

    def eq(a, b):
        return a == b

The core column expression unit :class:`_expression.ColumnElement`
overrides :meth:`.Operators.operate` and others
to return further :class:`_expression.ColumnElement` constructs,
so that the ``==`` operation above is replaced by a clause
construct.

.. seealso::

    :ref:`types_operators`

    :attr:`.TypeEngine.comparator_factory`

    :class:`.ColumnOperators`

    :class:`.PropComparator`

Constructeur(s)

Signature du constructeur Description
__init__(self, /, *args, **kwargs) Initialize self. See help(type(self)) for accurate signature. [extrait de __init__.__doc__]

Liste des attributs statiques

Nom de l'attribut Valeur
timetupleNone

Liste des opérateurs

Signature de l'opérateur Description
__add__(self, other: 'Any') -> 'ColumnOperators' Implement the ``+`` operator. [extrait de __add__.__doc__]
__contains__(self, other: 'Any') -> 'ColumnOperators'
__eq__(self, other: 'Any') -> 'ColumnOperators' Implement the ``==`` operator. [extrait de __eq__.__doc__]
__floordiv__(self, other: 'Any') -> 'ColumnOperators' Implement the ``//`` operator. [extrait de __floordiv__.__doc__]
__ge__(self, other: 'Any') -> 'ColumnOperators' Implement the ``>=`` operator. [extrait de __ge__.__doc__]
__getitem__(self, index: 'Any') -> 'ColumnOperators' Implement the [] operator. [extrait de __getitem__.__doc__]
__gt__(self, other: 'Any') -> 'ColumnOperators' Implement the ``>`` operator. [extrait de __gt__.__doc__]
__le__(self, other: 'Any') -> 'ColumnOperators' Implement the ``<=`` operator. [extrait de __le__.__doc__]
__lshift__(self, other: 'Any') -> 'ColumnOperators' implement the << operator. [extrait de __lshift__.__doc__]
__lt__(self, other: 'Any') -> 'ColumnOperators' Implement the ``<`` operator. [extrait de __lt__.__doc__]
__mod__(self, other: 'Any') -> 'ColumnOperators' Implement the ``%`` operator. [extrait de __mod__.__doc__]
__mul__(self, other: 'Any') -> 'ColumnOperators' Implement the ``*`` operator. [extrait de __mul__.__doc__]
__ne__(self, other: 'Any') -> 'ColumnOperators' Implement the ``!=`` operator. [extrait de __ne__.__doc__]
__neg__(self) -> 'ColumnOperators' Implement the ``-`` operator. [extrait de __neg__.__doc__]
__radd__(self, other: 'Any') -> 'ColumnOperators' Implement the ``+`` operator in reverse. [extrait de __radd__.__doc__]
__rfloordiv__(self, other: 'Any') -> 'ColumnOperators' Implement the ``//`` operator in reverse. [extrait de __rfloordiv__.__doc__]
__rmod__(self, other: 'Any') -> 'ColumnOperators' Implement the ``%`` operator in reverse. [extrait de __rmod__.__doc__]
__rmul__(self, other: 'Any') -> 'ColumnOperators' Implement the ``*`` operator in reverse. [extrait de __rmul__.__doc__]
__rshift__(self, other: 'Any') -> 'ColumnOperators' implement the >> operator. [extrait de __rshift__.__doc__]
__rsub__(self, other: 'Any') -> 'ColumnOperators' Implement the ``-`` operator in reverse. [extrait de __rsub__.__doc__]
__rtruediv__(self, other: 'Any') -> 'ColumnOperators' Implement the ``/`` operator in reverse. [extrait de __rtruediv__.__doc__]
__sub__(self, other: 'Any') -> 'ColumnOperators' Implement the ``-`` operator. [extrait de __sub__.__doc__]
__truediv__(self, other: 'Any') -> 'ColumnOperators' Implement the ``/`` operator. [extrait de __truediv__.__doc__]

Opérateurs hérités de la classe Operators

__and__, __invert__, __or__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
all_(self) -> 'ColumnOperators' Produce an :func:`_expression.all_` clause against the [extrait de all_.__doc__]
any_(self) -> 'ColumnOperators' Produce an :func:`_expression.any_` clause against the [extrait de any_.__doc__]
asc(self) -> 'ColumnOperators' Produce a :func:`_expression.asc` clause against the [extrait de asc.__doc__]
between(self, cleft: 'Any', cright: 'Any', symmetric: 'bool' = False) -> 'ColumnOperators' Produce a :func:`_expression.between` clause against [extrait de between.__doc__]
bitwise_and(self, other: 'Any') -> 'ColumnOperators' Produce a bitwise AND operation, typically via the ``&`` [extrait de bitwise_and.__doc__]
bitwise_lshift(self, other: 'Any') -> 'ColumnOperators' Produce a bitwise LSHIFT operation, typically via the ``<<`` [extrait de bitwise_lshift.__doc__]
bitwise_not(self) -> 'ColumnOperators' Produce a bitwise NOT operation, typically via the ``~`` [extrait de bitwise_not.__doc__]
bitwise_or(self, other: 'Any') -> 'ColumnOperators' Produce a bitwise OR operation, typically via the ``|`` [extrait de bitwise_or.__doc__]
bitwise_rshift(self, other: 'Any') -> 'ColumnOperators' Produce a bitwise RSHIFT operation, typically via the ``>>`` [extrait de bitwise_rshift.__doc__]
bitwise_xor(self, other: 'Any') -> 'ColumnOperators' Produce a bitwise XOR operation, typically via the ``^`` [extrait de bitwise_xor.__doc__]
collate(self, collation: 'str') -> 'ColumnOperators' Produce a :func:`_expression.collate` clause against [extrait de collate.__doc__]
concat(self, other: 'Any') -> 'ColumnOperators' Implement the 'concat' operator. [extrait de concat.__doc__]
contains(self, other: 'Any', **kw: 'Any') -> 'ColumnOperators' Implement the 'contains' operator. [extrait de contains.__doc__]
desc(self) -> 'ColumnOperators' Produce a :func:`_expression.desc` clause against the [extrait de desc.__doc__]
distinct(self) -> 'ColumnOperators' Produce a :func:`_expression.distinct` clause against the [extrait de distinct.__doc__]
endswith(self, other: 'Any', escape: 'Optional[str]' = None, autoescape: 'bool' = False) -> 'ColumnOperators' Implement the 'endswith' operator. [extrait de endswith.__doc__]
icontains(self, other: 'Any', **kw: 'Any') -> 'ColumnOperators' Implement the ``icontains`` operator, e.g. case insensitive [extrait de icontains.__doc__]
iendswith(self, other: 'Any', escape: 'Optional[str]' = None, autoescape: 'bool' = False) -> 'ColumnOperators' Implement the ``iendswith`` operator, e.g. case insensitive [extrait de iendswith.__doc__]
ilike(self, other: 'Any', escape: 'Optional[str]' = None) -> 'ColumnOperators' Implement the ``ilike`` operator, e.g. case insensitive LIKE. [extrait de ilike.__doc__]
in_(self, other: 'Any') -> 'ColumnOperators' Implement the ``in`` operator. [extrait de in_.__doc__]
is_(self, other: 'Any') -> 'ColumnOperators' Implement the ``IS`` operator. [extrait de is_.__doc__]
is_distinct_from(self, other: 'Any') -> 'ColumnOperators' Implement the ``IS DISTINCT FROM`` operator. [extrait de is_distinct_from.__doc__]
is_not(self, other: 'Any') -> 'ColumnOperators' Implement the ``IS NOT`` operator. [extrait de is_not.__doc__]
is_not_distinct_from(self, other: 'Any') -> 'ColumnOperators' Implement the ``IS NOT DISTINCT FROM`` operator. [extrait de is_not_distinct_from.__doc__]
isnot(self, other: 'Any') -> 'ColumnOperators' Implement the ``IS NOT`` operator. [extrait de is_not.__doc__]
isnot_distinct_from(self, other: 'Any') -> 'ColumnOperators' Implement the ``IS NOT DISTINCT FROM`` operator. [extrait de is_not_distinct_from.__doc__]
istartswith(self, other: 'Any', escape: 'Optional[str]' = None, autoescape: 'bool' = False) -> 'ColumnOperators' Implement the ``istartswith`` operator, e.g. case insensitive [extrait de istartswith.__doc__]
like(self, other: 'Any', escape: 'Optional[str]' = None) -> 'ColumnOperators' Implement the ``like`` operator. [extrait de like.__doc__]
match(self, other: 'Any', **kwargs: 'Any') -> 'ColumnOperators' Implements a database-specific 'match' operator. [extrait de match.__doc__]
not_ilike(self, other: 'Any', escape: 'Optional[str]' = None) -> 'ColumnOperators' implement the ``NOT ILIKE`` operator. [extrait de not_ilike.__doc__]
not_in(self, other: 'Any') -> 'ColumnOperators' implement the ``NOT IN`` operator. [extrait de not_in.__doc__]
not_like(self, other: 'Any', escape: 'Optional[str]' = None) -> 'ColumnOperators' implement the ``NOT LIKE`` operator. [extrait de not_like.__doc__]
notilike(self, other: 'Any', escape: 'Optional[str]' = None) -> 'ColumnOperators' implement the ``NOT ILIKE`` operator. [extrait de not_ilike.__doc__]
notin_(self, other: 'Any') -> 'ColumnOperators' implement the ``NOT IN`` operator. [extrait de not_in.__doc__]
notlike(self, other: 'Any', escape: 'Optional[str]' = None) -> 'ColumnOperators' implement the ``NOT LIKE`` operator. [extrait de not_like.__doc__]
nulls_first(self) -> 'ColumnOperators' Produce a :func:`_expression.nulls_first` clause against the [extrait de nulls_first.__doc__]
nulls_last(self) -> 'ColumnOperators' Produce a :func:`_expression.nulls_last` clause against the [extrait de nulls_last.__doc__]
nullsfirst(self) -> 'ColumnOperators' Produce a :func:`_expression.nulls_first` clause against the [extrait de nulls_first.__doc__]
nullslast(self) -> 'ColumnOperators' Produce a :func:`_expression.nulls_last` clause against the [extrait de nulls_last.__doc__]
regexp_match(self, pattern: 'Any', flags: 'Optional[str]' = None) -> 'ColumnOperators' Implements a database-specific 'regexp match' operator. [extrait de regexp_match.__doc__]
regexp_replace(self, pattern: 'Any', replacement: 'Any', flags: 'Optional[str]' = None) -> 'ColumnOperators' Implements a database-specific 'regexp replace' operator. [extrait de regexp_replace.__doc__]
startswith(self, other: 'Any', escape: 'Optional[str]' = None, autoescape: 'bool' = False) -> 'ColumnOperators' Implement the ``startswith`` operator. [extrait de startswith.__doc__]

Méthodes héritées de la classe Operators

__init_subclass__, __sa_operate__, __subclasshook__, bool_op, op, operate, reverse_operate

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __getstate__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__

Vous êtes un professionnel et vous avez besoin d'une formation ? Calcul scientifique
avec Python
Voir le programme détaillé