Author: lukeplant
Date: 2011-09-26 10:20:20 -0700 (Mon, 26 Sep 2011)
New Revision: 16907
Modified:
django/trunk/django/contrib/contenttypes/generic.py
django/trunk/django/db/models/fields/related.py
Log:
Removed unused parameter 'join_table' in various bits of RelatedManager code
Modified: django/trunk/django/contrib/contenttypes/generic.py
===================================================================
--- django/trunk/django/contrib/contenttypes/generic.py 2011-09-26 11:24:38 UTC
(rev 16906)
+++ django/trunk/django/contrib/contenttypes/generic.py 2011-09-26 17:20:20 UTC
(rev 16907)
@@ -219,7 +219,6 @@
model = rel_model,
instance = instance,
symmetrical = (self.field.rel.symmetrical and instance.__class__
== rel_model),
- join_table = qn(self.field.m2m_db_table()),
source_col_name = qn(self.field.m2m_column_name()),
target_col_name = qn(self.field.m2m_reverse_name()),
content_type =
ContentType.objects.db_manager(instance._state.db).get_for_model(instance),
@@ -246,7 +245,7 @@
class GenericRelatedObjectManager(superclass):
def __init__(self, model=None, core_filters=None, instance=None,
symmetrical=None,
- join_table=None, source_col_name=None,
target_col_name=None, content_type=None,
+ source_col_name=None, target_col_name=None,
content_type=None,
content_type_field_name=None, object_id_field_name=None):
super(GenericRelatedObjectManager, self).__init__()
@@ -255,8 +254,6 @@
self.content_type = content_type
self.symmetrical = symmetrical
self.instance = instance
- self.join_table = join_table
- self.join_table = model._meta.db_table
self.source_col_name = source_col_name
self.target_col_name = target_col_name
self.content_type_field_name = content_type_field_name
Modified: django/trunk/django/db/models/fields/related.py
===================================================================
--- django/trunk/django/db/models/fields/related.py 2011-09-26 11:24:38 UTC
(rev 16906)
+++ django/trunk/django/db/models/fields/related.py 2011-09-26 17:20:20 UTC
(rev 16907)
@@ -474,8 +474,7 @@
through = rel.through
class ManyRelatedManager(superclass):
def __init__(self, model=None, core_filters=None, instance=None,
symmetrical=None,
- join_table=None, source_field_name=None,
target_field_name=None,
- reverse=False):
+ source_field_name=None, target_field_name=None,
reverse=False):
super(ManyRelatedManager, self).__init__()
self.core_filters = core_filters
self.model = model
@@ -544,9 +543,8 @@
get_or_create.alters_data = True
def _add_items(self, source_field_name, target_field_name, *objs):
- # join_table: name of the m2m link table
- # source_field_name: the PK fieldname in join_table for the source
object
- # target_field_name: the PK fieldname in join_table for the target
object
+ # source_field_name: the PK fieldname in join table for the source
object
+ # target_field_name: the PK fieldname in join table for the target
object
# *objs - objects to add. Either object instances, or primary keys
of object instances.
# If there aren't any objects, there is nothing to do.
@@ -593,8 +591,8 @@
model=self.model, pk_set=new_ids, using=db)
def _remove_items(self, source_field_name, target_field_name, *objs):
- # source_col_name: the PK colname in join_table for the source
object
- # target_col_name: the PK colname in join_table for the target
object
+ # source_field_name: the PK colname in join table for the source
object
+ # target_field_name: the PK colname in join table for the target
object
# *objs - objects to remove
# If there aren't any objects, there is nothing to do.
@@ -629,7 +627,7 @@
def _clear_items(self, source_field_name):
db = router.db_for_write(self.through, instance=self.instance)
- # source_col_name: the PK colname in join_table for the source
object
+ # source_field_name: the PK colname in join table for the source
object
if self.reverse or source_field_name == self.source_field_name:
# Don't send the signal when we are clearing the
# duplicate data rows for symmetrical reverse entries.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.