Note: this PR includes a backwards-incompatible change and as such will necessitate a 2.0 release. See this discussion for details.
The new docs branch (#59) will need to be updated to include this new function.
This exposes a general purpose annotate function under pairs which closely mirrors the annotate method on QuerySet, and sits below the existing count and has shortcut pair functions (and the soon-to-exist sum function).
If you're doing custom things with annotations, it replaces this:
This feels more "Django" than our own count, has, sum functions, at the expensive of slightly more code and an additional import (the aggregate objects such as Count).
Note: this PR includes a backwards-incompatible change and as such will necessitate a 2.0 release. See this discussion for details.
The new docs branch (#59) will need to be updated to include this new function.
This exposes a general purpose
annotate
function underpairs
which closely mirrors theannotate
method onQuerySet
, and sits below the existingcount
andhas
shortcut pair functions (and the soon-to-exist sum function).If you're doing custom things with annotations, it replaces this:
with this:
This feels more "Django" than our own
count
,has
,sum
functions, at the expensive of slightly more code and an additional import (the aggregate objects such asCount
).