Commits

Jeremy Self  committed 88a00a6

use table_map when tables isn't populated

  • Participants
  • Parent commits 760b46b

Comments (0)

Files changed (1)

File johnny/cache.py

     with their own dependent queries, etc."""
     from django.db.models.sql.where import WhereNode
     from django.db.models.query import QuerySet
-    tables = list(query.tables)
+    tables = list(query.tables) or getattr(query, 'table_map', {}).keys()
 
     def get_tables(where_node, tables):
         for child in where_node.children: