Removed models/related.py BoundRelatedObject

The class wasn't used anywhere except in RelatedObject.bind(), which
wasn't used anywhere. The class had one method defined as
NotImplemented, yet the class wasn't subclassed anywhere. In short, the
class was dead code.
This commit is contained in:
Anssi Kääriäinen 2013-01-18 15:57:17 +02:00
parent 3647c0a49a
commit 56f34f9f22
1 changed files with 0 additions and 14 deletions

View File

@ -10,17 +10,6 @@ PathInfo = namedtuple('PathInfo',
'from_field to_field from_opts to_opts join_field ' 'from_field to_field from_opts to_opts join_field '
'm2m direct') 'm2m direct')
class BoundRelatedObject(object):
def __init__(self, related_object, field_mapping, original):
self.relation = related_object
self.field_mappings = field_mapping[related_object.name]
def template_name(self):
raise NotImplementedError
def __repr__(self):
return repr(self.__dict__)
class RelatedObject(object): class RelatedObject(object):
def __init__(self, parent_model, model, field): def __init__(self, parent_model, model, field):
self.parent_model = parent_model self.parent_model = parent_model
@ -58,9 +47,6 @@ class RelatedObject(object):
def __repr__(self): def __repr__(self):
return "<RelatedObject: %s related to %s>" % (self.name, self.field.name) return "<RelatedObject: %s related to %s>" % (self.name, self.field.name)
def bind(self, field_mapping, original, bound_related_object_class=BoundRelatedObject):
return bound_related_object_class(self, field_mapping, original)
def get_accessor_name(self): def get_accessor_name(self):
# This method encapsulates the logic that decides what name to give an # This method encapsulates the logic that decides what name to give an
# accessor descriptor that retrieves related many-to-one or # accessor descriptor that retrieves related many-to-one or