1
0
mirror of https://github.com/django/django.git synced 2025-10-27 23:56:08 +00:00

Adding 'sqlmigrate' command and quote_parameter to support it.

This commit is contained in:
Andrew Godwin
2013-09-06 15:27:51 -05:00
parent 5ca290f5db
commit efd1e6096e
13 changed files with 169 additions and 22 deletions

View File

@@ -93,11 +93,4 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
return self.normalize_name(for_name + "_" + suffix)
def prepare_default(self, value):
if isinstance(value, (datetime.date, datetime.time, datetime.datetime)):
return "'%s'" % value
elif isinstance(value, six.string_types):
return repr(value)
elif isinstance(value, bool):
return "1" if value else "0"
else:
return str(value)
return self.connection.ops.quote_parameter(value)