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

@ -305,6 +305,11 @@ class DatabaseOperations(BaseDatabaseOperations):
return name # Quoting once is enough.
return "`%s`" % name
def quote_parameter(self, value):
# Inner import to allow module to fail to load gracefully
import MySQLdb.converters
return MySQLdb.escape(value, MySQLdb.converters.conversions)
def random_function_sql(self):
return 'RAND()'
@ -518,9 +523,9 @@ class DatabaseWrapper(BaseDatabaseWrapper):
table_name, column_name, bad_row[1],
referenced_table_name, referenced_column_name))
def schema_editor(self):
def schema_editor(self, *args, **kwargs):
"Returns a new instance of this backend's SchemaEditor"
return DatabaseSchemaEditor(self)
return DatabaseSchemaEditor(self, *args, **kwargs)
def is_usable(self):
try: