Suor / django-cacheops

A slick ORM cache with automatic granular event-driven invalidation.
BSD 3-Clause "New" or "Revised" License
2.12k stars 227 forks source link

`.aggregate()` is broken on 7.0 #452

Closed ukrarome closed 1 year ago

ukrarome commented 1 year ago

Caching on .aggregate() method is broken in PR #https://github.com/Suor/django-cacheops/commit/e277e1ea09258cd981091be777abcc3cef79b03a It no longer takes aliases into account Example:

s.packages.all().aggregate(dives=Max('dives_in_package'))
>> {'dives': None}

# cache
s.packages.all().aggregate(another_alias=Max('dives_in_package'))
>> {'dives': None}

# no cache
s.packages.all().nocache().aggregate(another_alias=Max('dives_in_package'))
>> {'another_alias': None}
Suor commented 1 year ago

Interesting, can you make a test of it? There is an instruction in README.

ukrarome commented 1 year ago

Is it fixed?

Suor commented 1 year ago

Yes

ukrarome commented 1 year ago

7.0.1 - still not working