1. Jannis Leidel
  2. johnny-cache


Patrick Jenkins  committed 318cbcc

A django.db.models.options.Options object is not guranteed to have a _related_objects_cache. Johnny-cache does not check to see if this is the case. We need to check to see if _related_objects_cache is an attribute of the django.db.models.options.Options we're examining and if not we need to call _fill_related_objects_cache().

  • Participants
  • Parent commits 71cadf4
  • Branches default

Comments (0)

Files changed (1)

File johnny/cache.py

View file
  • Ignore whitespace
+            try:
+                 instance._meta._related_objects_cache
+            except AttributeError:
+                 instance._meta._fill_related_objects_cache()
             for obj in instance._meta._related_objects_cache.keys():
                 obj_table = obj.model._meta.db_table
                 if obj_table not in tables: