jmoiron / johnny-cache

johnny cache django caching framework
MIT License
304 stars 83 forks source link

(Django>=1.6) AttributeError: 'Query' object has no attribute 'ordering_aliases' #29

Open karanlyons opened 11 years ago

karanlyons commented 11 years ago

It looks like ordering_aliases has moved out of the Query object in db/models/sql/query.py into the SQLCompiler object in db/models/sql/compiler.py, as of django/django@2f35c6f10fcbae541691207fb0c0560a13b754fc.

As a result, the line in johnny/cache.py referencing cls.query.ordering_aliases fail with an AttributeError.

I'm not entirely sure how easy this is to fix. It looks like cls refers to SQLCompiler and so now has an ordering_aliases property, but I don't know enough about these parts of Django and johnny-cache to confirm that swapping out cls.query.ordering_aliases for cls.ordering_aliases is a viable solution. But it seems to work.

BertrandBordage commented 10 years ago

This issue can be closed.

dwickwire commented 8 years ago

Clearing the cache resolves this.