diff --git a/AUTHORS b/AUTHORS index a605cb2105e..b291f224001 100644 --- a/AUTHORS +++ b/AUTHORS @@ -91,6 +91,7 @@ answer newbie questions, and generally made Django that much better: Kieran Holland Robert Rock Howard Jason Huggins + Baurzhan Ismagulov jcrasta@gmail.com Michael Josephson jpellerin@gmail.com diff --git a/django/db/models/base.py b/django/db/models/base.py index bdae7eccc29..13209a97acc 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) # ############################################