diff options
-rw-r--r-- | views.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -15,7 +15,6 @@ import datetime -from django.contrib.postgres.aggregates import ArrayAgg from django.db import connection from django.db.models import Count, Max from django.db.models.expressions import RawSQL @@ -30,6 +29,9 @@ from .utils import get_current_week, get_current_or_next_week, get_week, group_c import edt +if connection.vendor == "postgresql": + from django.contrib.postgres.aggregates import ArrayAgg + def index(request): years = Year.objects.order_by("name") return render(request, "index.html", {"elements": years}) |