etianen / django-reversion

django-reversion is an extension to the Django web framework that provides version control for model instances.
https://django-reversion.readthedocs.io
BSD 3-Clause "New" or "Revised" License
3.05k stars 489 forks source link

perf: Fixes N+1 queries while rendering the recover_list.html template #955

Closed armonge closed 11 months ago

armonge commented 11 months ago

While running a project with django-reversion and Sentry we found out there's one template that makes a query to the DB on every iteration. This PR fixes that

https://docs.sentry.io/product/issues/issue-details/performance-issues/n-one-queries/ https://docs.djangoproject.com/en/5.0/ref/models/querysets/#django.db.models.query.QuerySet.select_related

etianen commented 11 months ago

Very nice, I'll release shortly.