citusdata / django-multitenant

Python/Django support for distributed multi-tenant databases like Postgres+Citus
MIT License
730 stars 118 forks source link

Fix aggregation with annotate #108

Closed JelteF closed 2 years ago

JelteF commented 2 years ago

As described in #63 and #64 there is an issue with the way django optimizes queries when aggregating that does not work for TenantModels. This uses the fix and test originally contributed by @ledburyb in #64. However, it makes the test work on Python 3 and also changes it to use a better fix for Django 3.0+.

Closes #63 Closes #64