]> git.ipfire.org Git - thirdparty/patchwork.git/commit
models: Make use of aggregates
authorStephen Finucane <stephen@that.guru>
Thu, 20 Oct 2016 07:28:53 +0000 (08:28 +0100)
committerStephen Finucane <stephen@that.guru>
Sat, 22 Oct 2016 10:22:36 +0000 (11:22 +0100)
commit2cce6b62bab7eb289c6e7c69fad5f7a669810c60
tree87e9e8a8fe14c624479e646ad67883fd197d5c63
parente049ec68c9d310d48ca2cae7aa1474a350e53f47
models: Make use of aggregates

We're well past Django 1.1 now, so resolve a TODO to use aggregate
support introduced in this version. As part of this change, replace
the use of 'count' to check for presence of matching objects with
'exists'.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Reviewed-by: Daniel Axtens <dja@axtens.net>
patchwork/models.py