From: Dan Gittik Date: Thu, 16 Jul 2015 23:26:31 +0000 (+0300) Subject: Added support for reflected modulo operator. X-Git-Tag: rel_1_0_7~12^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=249bc5be0038dcf69a94ad558d7bd4c1012a47c4;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Added support for reflected modulo operator. --- diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index 51f162c98e..17a9d30862 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -597,6 +597,14 @@ class ColumnOperators(Operators): """ return self.reverse_operate(div, other) + def __rmod__(self, other): + """Implement the ``%`` operator in reverse. + + See :meth:`.ColumnOperators.__mod__`. + + """ + return self.reverse_operate(mod, other) + def between(self, cleft, cright, symmetric=False): """Produce a :func:`~.expression.between` clause against the parent object, given the lower and upper range.