diff options
| author | Andrew Godwin <andrew@aeracode.org> | 2014-01-25 00:09:56 +0000 |
|---|---|---|
| committer | Andrew Godwin <andrew@aeracode.org> | 2014-01-25 00:10:25 +0000 |
| commit | 2a30b39f40265c9228fc2e706bcb6e1df1aae991 (patch) | |
| tree | 7e03de71322194db39bfe428e9e23264e20e7d79 /django/db/backends/sqlite3 | |
| parent | 06bd181f97e5e5561ae7e80efae4c38ee670773f (diff) | |
Fixed #21783: More SQLite default fun with nulls.
Diffstat (limited to 'django/db/backends/sqlite3')
| -rw-r--r-- | django/db/backends/sqlite3/base.py | 6 | ||||
| -rw-r--r-- | django/db/backends/sqlite3/schema.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py index cf0326db27..3c8f170b7d 100644 --- a/django/db/backends/sqlite3/base.py +++ b/django/db/backends/sqlite3/base.py @@ -223,12 +223,12 @@ class DatabaseOperations(BaseDatabaseOperations): except _sqlite3.ProgrammingError: pass # Manual emulation of SQLite parameter quoting - if isinstance(value, six.integer_types): + if isinstance(value, type(True)): + return str(int(value)) + elif isinstance(value, six.integer_types): return str(value) elif isinstance(value, six.string_types): return '"%s"' % six.text_type(value) - elif isinstance(value, type(True)): - return str(int(value)) elif value is None: return "NULL" else: diff --git a/django/db/backends/sqlite3/schema.py b/django/db/backends/sqlite3/schema.py index 1ad5bfc17b..cd80d457c6 100644 --- a/django/db/backends/sqlite3/schema.py +++ b/django/db/backends/sqlite3/schema.py @@ -30,7 +30,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): for field in create_fields: body[field.name] = field # If there's a default, insert it into the copy map - if field.get_default(): + if field.has_default(): mapping[field.column] = self.connection.ops.quote_parameter( field.get_default() ) |
