Commit 42e79ced authored by Joren Vrancken's avatar Joren Vrancken Committed by Thom Wiggers
Browse files

Sort association documents by name

parent e646508d
...@@ -6,6 +6,7 @@ from django.http import Http404 ...@@ -6,6 +6,7 @@ from django.http import Http404
from django.shortcuts import get_object_or_404, redirect, render from django.shortcuts import get_object_or_404, redirect, render
from django.utils import timezone from django.utils import timezone
from django.utils.text import slugify from django.utils.text import slugify
from django.utils.translation import get_language
from sendfile import sendfile from sendfile import sendfile
from documents.models import (AnnualDocument, AssociationDocument, from documents.models import (AnnualDocument, AssociationDocument,
...@@ -45,7 +46,11 @@ def index(request): ...@@ -45,7 +46,11 @@ def index(request):
years[meeting_year]['general_meetings'].append(obj) years[meeting_year]['general_meetings'].append(obj)
return render(request, 'documents/index.html', { return render(request, 'documents/index.html', {
'association_documents': AssociationDocument.objects.all(), 'association_documents':
AssociationDocument
.objects
.order_by(f'name_{ get_language() }')
.all(),
'years': list(years.items()) 'years': list(years.items())
}) })
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment