diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2010-06-07 17:53:34 +0000 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2010-06-07 17:53:34 +0000 |
| commit | 1f9e422b8d31303a97da950edab3678f4e42f024 (patch) | |
| tree | 7297167c64a1cc05b2c1c935b1ec939e00086858 /django/db | |
| parent | 4c45befaad280ec3b1b330a4787564081b8fac6f (diff) | |
[soc2010/query-refactor] Refactor, and implement a few more methods to get models saving under the mongodb backend.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/query-refactor@13332 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db')
| -rw-r--r-- | django/db/models/query.py | 2 | ||||
| -rw-r--r-- | django/db/models/sql/compiler.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py index d9fbd9b8cb..a2a82f85ee 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -1476,4 +1476,4 @@ def insert_query(model, values, return_id=False, raw_values=False, using=None): """ query = sql.InsertQuery(model) query.insert_values(values, raw_values) - return query.get_compiler(using=using).execute_sql(return_id) + return query.get_compiler(using=using).insert(return_id) diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index eaf2cd2569..2877171fd2 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -787,6 +787,9 @@ class SQLInsertCompiler(SQLCompiler): return self.connection.ops.fetch_returned_insert_id(cursor) return self.connection.ops.last_insert_id(cursor, self.query.model._meta.db_table, self.query.model._meta.pk.column) + + def insert(self, *args, **kwargs): + return self.execute_sql(*args, **kwargs) class SQLDeleteCompiler(SQLCompiler): |
