From 56f34f9f225026ccd8e36b2cf917d09b8f55d393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anssi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Fri, 18 Jan 2013 15:57:17 +0200 Subject: [PATCH] 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. --- django/db/models/related.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/django/db/models/related.py b/django/db/models/related.py index 702853533d..26932137ad 100644 --- a/django/db/models/related.py +++ b/django/db/models/related.py @@ -10,17 +10,6 @@ PathInfo = namedtuple('PathInfo', 'from_field to_field from_opts to_opts join_field ' '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): def __init__(self, parent_model, model, field): self.parent_model = parent_model @@ -58,9 +47,6 @@ class RelatedObject(object): def __repr__(self): return "" % (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): # This method encapsulates the logic that decides what name to give an # accessor descriptor that retrieves related many-to-one or