johnny-cache
johnny-cache copied to clipboard
(Django>=1.6) AttributeError: 'Query' object has no attribute 'ordering_aliases'
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.