diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-07-17 17:27:34 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-07-17 17:27:34 +0000 |
| commit | 58df4ce6364643732c6b2d9ab2d4a0254f5e1a89 (patch) | |
| tree | b145db7a577f355986f383feafc0bcea37335333 | |
| parent | 6ae4def03b600a515f5715c3842d618d2fa1e84b (diff) | |
Fixed #40 -- Removed legacy code from meta.py method_set_related_many_to_many(). Thanks, jforeman@hark.org
git-svn-id: http://code.djangoproject.com/svn/django/trunk@157 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/core/meta.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/django/core/meta.py b/django/core/meta.py index 806035b3dc..68ee1f2b22 100644 --- a/django/core/meta.py +++ b/django/core/meta.py @@ -894,12 +894,8 @@ def method_set_related_many_to_many(rel_opts, rel_field, self, id_list): this_id = getattr(self, self._meta.pk.name) cursor = db.db.cursor() cursor.execute("DELETE FROM %s WHERE %s_id = %%s" % (m2m_table, rel.object_name.lower()), [this_id]) - if rel_field.rel.orderable: - sql = "INSERT INTO %s (%s_id, %s_id, _order) VALUES (%%s, %%s, %%s)" % (m2m_table, rel.object_name.lower(), rel_opts.object_name.lower()) - cursor.executemany(sql, [(this_id, j, i) for i, j in enumerate(id_list)]) - else: - sql = "INSERT INTO %s (%s_id, %s_id) VALUES (%%s, %%s)" % (m2m_table, rel.object_name.lower(), rel_opts.object_name.lower()) - cursor.executemany(sql, [(this_id, i) for i in id_list]) + sql = "INSERT INTO %s (%s_id, %s_id) VALUES (%%s, %%s)" % (m2m_table, rel.object_name.lower(), rel_opts.object_name.lower()) + cursor.executemany(sql, [(this_id, i) for i in id_list]) db.db.commit() # ORDERING METHODS ######################### |
