Commits

Mike Bayer committed 1493f6f

added __mod__ type

  • Participants
  • Parent commits 64f6811
  • Tags rel_0_1_7

Comments (0)

Files changed (3)

 0.1.7
 - some fixes to topological sort algorithm
 - added DISTINCT ON support to Postgres (just supply distinct=[col1,col2..])
+- added __mod__ (% operator) to sql expressions
 - "order_by" mapper property inherited from inheriting mapper
 - fix to column type used when mapper UPDATES/DELETEs
 - with convert_unicode=True, reflection was failing, has been fixed

File lib/sqlalchemy/sql.py

         return self._operate('*', other)
     def __div__(self, other):
         return self._operate('/', other)
+    def __mod__(self, other):
+        return self._operate('%', other)
     def __truediv__(self, other):
         return self._operate('/', other)
     def _bind_param(self, obj):

File lib/sqlalchemy/types.py

     def engine_impl(self, engine):
         try:
             return self.impl_dict[engine]
-        except:
+        except KeyError:
             return self.impl_dict.setdefault(engine, engine.type_descriptor(self))
     def get_col_spec(self):
         raise NotImplementedError()