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
This commit is contained in:
Luke Plant 2011-09-26 17:20:20 +00:00
parent 0febe3b5bb
commit 29b8e34dfb
2 changed files with 7 additions and 12 deletions

View File

@ -219,7 +219,6 @@ class ReverseGenericRelatedObjectsDescriptor(object):
model = rel_model, model = rel_model,
instance = instance, instance = instance,
symmetrical = (self.field.rel.symmetrical and instance.__class__ == rel_model), 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()), source_col_name = qn(self.field.m2m_column_name()),
target_col_name = qn(self.field.m2m_reverse_name()), target_col_name = qn(self.field.m2m_reverse_name()),
content_type = ContentType.objects.db_manager(instance._state.db).get_for_model(instance), 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): class GenericRelatedObjectManager(superclass):
def __init__(self, model=None, core_filters=None, instance=None, symmetrical=None, 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): content_type_field_name=None, object_id_field_name=None):
super(GenericRelatedObjectManager, self).__init__() super(GenericRelatedObjectManager, self).__init__()
@ -255,8 +254,6 @@ def create_generic_related_manager(superclass):
self.content_type = content_type self.content_type = content_type
self.symmetrical = symmetrical self.symmetrical = symmetrical
self.instance = instance self.instance = instance
self.join_table = join_table
self.join_table = model._meta.db_table
self.source_col_name = source_col_name self.source_col_name = source_col_name
self.target_col_name = target_col_name self.target_col_name = target_col_name
self.content_type_field_name = content_type_field_name self.content_type_field_name = content_type_field_name

View File

@ -474,8 +474,7 @@ def create_many_related_manager(superclass, rel=False):
through = rel.through through = rel.through
class ManyRelatedManager(superclass): class ManyRelatedManager(superclass):
def __init__(self, model=None, core_filters=None, instance=None, symmetrical=None, def __init__(self, model=None, core_filters=None, instance=None, symmetrical=None,
join_table=None, source_field_name=None, target_field_name=None, source_field_name=None, target_field_name=None, reverse=False):
reverse=False):
super(ManyRelatedManager, self).__init__() super(ManyRelatedManager, self).__init__()
self.core_filters = core_filters self.core_filters = core_filters
self.model = model self.model = model
@ -544,9 +543,8 @@ def create_many_related_manager(superclass, rel=False):
get_or_create.alters_data = True get_or_create.alters_data = True
def _add_items(self, source_field_name, target_field_name, *objs): 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
# 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
# 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. # *objs - objects to add. Either object instances, or primary keys of object instances.
# If there aren't any objects, there is nothing to do. # 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) model=self.model, pk_set=new_ids, using=db)
def _remove_items(self, source_field_name, target_field_name, *objs): def _remove_items(self, source_field_name, target_field_name, *objs):
# 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
# target_col_name: the PK colname in join_table for the target object # target_field_name: the PK colname in join table for the target object
# *objs - objects to remove # *objs - objects to remove
# If there aren't any objects, there is nothing to do. # 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): def _clear_items(self, source_field_name):
db = router.db_for_write(self.through, instance=self.instance) 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: if self.reverse or source_field_name == self.source_field_name:
# Don't send the signal when we are clearing the # Don't send the signal when we are clearing the
# duplicate data rows for symmetrical reverse entries. # duplicate data rows for symmetrical reverse entries.