Commits

Mike Bayer  committed 8dd2564

none check for pg1 date/time values

  • Participants
  • Parent commits a702126

Comments (0)

Files changed (1)

File lib/sqlalchemy/databases/postgres.py

     def convert_bind_param(self, value, engine):
         # TODO: perform appropriate postgres1 conversion between Python DateTime/MXDateTime
         # this one doesnt seem to work with the "emulation" mode
-        return psycopg.TimestampFromMx(value)
+        if value is not None:
+            return psycopg.TimestampFromMx(value)
+        else:
+            return None
     def convert_result_value(self, value, engine):
         # TODO: perform appropriate postgres1 conversion between Python DateTime/MXDateTime
         return value
     def convert_bind_param(self, value, engine):
         # TODO: perform appropriate postgres1 conversion between Python DateTime/MXDateTime
         # this one doesnt seem to work with the "emulation" mode
-        return psycopg.DateFromMx(value)
+        if value is not None:
+            return psycopg.DateFromMx(value)
+        else:
+            return None
     def convert_result_value(self, value, engine):
         # TODO: perform appropriate postgres1 conversion between Python DateTime/MXDateTime
         return value
     def convert_bind_param(self, value, engine):
         # TODO: perform appropriate postgres1 conversion between Python DateTime/MXDateTime
         # this one doesnt seem to work with the "emulation" mode
-        return psycopg.TimeFromMx(value)
+        if value is not None:
+            return psycopg.TimeFromMx(value)
+        else:
+            return None
     def convert_result_value(self, value, engine):
         # TODO: perform appropriate postgres1 conversion between Python DateTime/MXDateTime
         return value