Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 77bdaa76dfdcb03ba482e8516d05a570fe100730 1 parent 4bead6e
Russell Keith-Magee freakboy3742 authored
Showing with 1 addition and 18 deletions.
  1. +1 −0  AUTHORS
  2. +0 −18 django/db/models/base.py
1  AUTHORS
View
@@ -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
18 django/db/models/base.py
View
@@ -376,24 +376,6 @@ def _get_image_dimensions(self, field):
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) #
############################################
Please sign in to comment.
Something went wrong with that request. Please try again.