From 29b8e34dfb27603ee3cf4fec67351c3a7a839c7c Mon Sep 17 00:00:00 2001 From: Luke Plant Date: Mon, 26 Sep 2011 17:20:20 +0000 Subject: [PATCH] Removed unused parameter 'join_table' in various bits of RelatedManager code git-svn-id: http://code.djangoproject.com/svn/django/trunk@16907 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/contenttypes/generic.py | 5 +---- django/db/models/fields/related.py | 14 ++++++-------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/django/contrib/contenttypes/generic.py b/django/contrib/contenttypes/generic.py index 69dd527037..5c6d61cb40 100644 --- a/django/contrib/contenttypes/generic.py +++ b/django/contrib/contenttypes/generic.py @@ -219,7 +219,6 @@ class ReverseGenericRelatedObjectsDescriptor(object): 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 @@ def create_generic_related_manager(superclass): 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 @@ def create_generic_related_manager(superclass): 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 diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py index fa7b482f24..9aa3c7e85e 100644 --- a/django/db/models/fields/related.py +++ b/django/db/models/fields/related.py @@ -474,8 +474,7 @@ def create_many_related_manager(superclass, rel=False): 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 @@ def create_many_related_manager(superclass, rel=False): 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 @@ def create_many_related_manager(superclass, rel=False): 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 create_many_related_manager(superclass, rel=False): 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.