Michael Elsdörfer  committed 22af0b3

Port broken things to Django 1.4.

  • Participants
  • Parent commits 92f11ed

Comments (0)

Files changed (2)

File djutils/

     def resolve(self, *args, **kwargs):
         result = RegexURLPattern.resolve(self, *args, **kwargs)
         if result:
-            result = list(result)
-            result[0] = self._decorate_with(result[0])
+            result.func = self._decorate_with(result.func)
         return result
     class TemplateCallableDescriptor(object):
         def __get__(self, instance, klass):
             return GetAttrCaller(instance)
-    return TemplateCallableDescriptor()
+    return TemplateCallableDescriptor()

File djutils/models/

     return obj.__class__(**initial)
-from django.db.models.query import CollectedObjects
 def has_related_objects(obj, ignore=[]):
     """Returns ``True`` if the model instance ``obj`` has any related
     objects depending on it.
     # TODO: add tests
-    subobjs = CollectedObjects()
-    obj._collect_sub_objects(subobjs)
+    related = obj._meta.get_all_related_objects()
     model = type(obj)
-    for so_klass in subobjs.unordered_keys():
+    for so_klass in related:
         # Auto-created m2m models we don't care about. The admin ignores
         # those in it's ``django.contrib.admin.util.NestedObjects`` class.
         if so_klass._meta.auto_created:
         # -> So there is at least one related object that counts
         return True
-    return False
+    return False