]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Added support for reflected modulo operator.
authorDan Gittik <dan.gittik@gmail.com>
Thu, 16 Jul 2015 23:26:31 +0000 (02:26 +0300)
committerDan Gittik <dan.gittik@gmail.com>
Thu, 16 Jul 2015 23:26:31 +0000 (02:26 +0300)
lib/sqlalchemy/sql/operators.py

index 51f162c98e53904935c3aa8d9d759d545325ac93..17a9d30862b8211be9592b1f0e4ffe87af4250b8 100644 (file)
@@ -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.