diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2006-11-03 02:14:46 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2006-11-03 02:14:46 +0000 |
| commit | 77bdaa76dfdcb03ba482e8516d05a570fe100730 (patch) | |
| tree | 5fddb61b2e64f64a3df547e6ebfc8083bc9e57da | |
| parent | 4bead6e99f380d9788dd14ef1dab4b60a6ccdd9e (diff) | |
Removed fossilized remnant of pre-magic removal m2m code. Thanks for the report, Baurzhan Ismagulov.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3963 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | AUTHORS | 1 | ||||
| -rw-r--r-- | django/db/models/base.py | 18 |
2 files changed, 1 insertions, 18 deletions
@@ -91,6 +91,7 @@ answer newbie questions, and generally made Django that much better: Kieran Holland <http://www.kieranholland.com> Robert Rock Howard <http://djangomojo.com/> Jason Huggins <http://www.jrandolph.com/blog/> + Baurzhan Ismagulov <ibr@radix50.net> jcrasta@gmail.com Michael Josephson <http://www.sdjournal.com/> jpellerin@gmail.com diff --git a/django/db/models/base.py b/django/db/models/base.py index bdae7eccc2..13209a97ac 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -376,24 +376,6 @@ class Model(object): setattr(self, cachename, get_image_dimensions(filename)) return getattr(self, cachename) - # Handles setting many-to-many related objects. - # Example: Album.set_songs() - def _set_related_many_to_many(self, rel_class, rel_field, id_list): - id_list = map(int, id_list) # normalize to integers - rel = rel_field.rel.to - m2m_table = rel_field.m2m_db_table() - this_id = self._get_pk_val() - cursor = connection.cursor() - cursor.execute("DELETE FROM %s WHERE %s = %%s" % \ - (backend.quote_name(m2m_table), - backend.quote_name(rel_field.m2m_column_name())), [this_id]) - sql = "INSERT INTO %s (%s, %s) VALUES (%%s, %%s)" % \ - (backend.quote_name(m2m_table), - backend.quote_name(rel_field.m2m_column_name()), - backend.quote_name(rel_field.m2m_reverse_name())) - cursor.executemany(sql, [(this_id, i) for i in id_list]) - transaction.commit_unless_managed() - ############################################ # HELPER FUNCTIONS (CURRIED MODEL METHODS) # ############################################ |
