Commits

Michael Manfre  committed d6d692a

Silence deprecation warnings for BigAutoField and BigForeignKey

  • Participants
  • Parent commits 394b1a6

Comments (0)

Files changed (1)

File sqlserver_ado/fields.py

             raise ValidationError(
                 _("This value must be a long."))
 
-    def get_db_prep_value(self, value):
+    def get_db_prep_value(self, value, connection=None, prepared=False):
         if value is None:
             return None
         return long(value)
 
 class BigForeignKey(ForeignKey):
     """A ForeignKey field that points to a BigAutoField or BigIntegerField"""
-    def db_type(self):
-        return BigIntegerField().db_type()
+    def db_type(self, connection=None):
+        try:
+            return BigIntegerField().db_type(connection=connection)
+        except AttributeError:
+            return BigIntegerField().db_type()