Ticket #16458: 16458_admin_fix.diff

File 16458_admin_fix.diff, 629 bytes (added by Anssi Kääriäinen, 13 years ago)

admin NestedCollector fix

  • django/contrib/admin/util.py

    diff --git a/django/contrib/admin/util.py b/django/contrib/admin/util.py
    index 7204a12..f69ad4a 100644
    a b class NestedObjects(Collector):  
    133133        return qs.select_related(related.field.name)
    134134
    135135    def _nested(self, obj, seen, format_callback):
    136         if obj in seen:
     136        if (obj.__class__, obj) in seen:
    137137            return []
    138         seen.add(obj)
     138        seen.add((obj.__class__, obj))
    139139        children = []
    140140        for child in self.edges.get(obj, ()):
    141141            children.extend(self._nested(child, seen, format_callback))
Back to Top