From dd117fdebb405b090f7d21118aea91622fe49090 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sat, 27 Apr 2024 23:30:47 +0200 Subject: [PATCH] suppression des accents pour le tri --- src/agenda_culturel/settings/base.py | 1 + src/agenda_culturel/views.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/agenda_culturel/settings/base.py b/src/agenda_culturel/settings/base.py index 6be9f26..cd20fcf 100644 --- a/src/agenda_culturel/settings/base.py +++ b/src/agenda_culturel/settings/base.py @@ -48,6 +48,7 @@ INSTALLED_APPS = [ 'ckeditor', 'recurrence', 'location_field.apps.DefaultConfig', + 'django.contrib.postgres', ] MIDDLEWARE = [ diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index aaf9023..f534ed5 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -177,7 +177,7 @@ def mentions_legales(request): return render(request, 'agenda_culturel/page-single.html', context) def about(request): - rimports = RecurrentImport.objects.order_by("name").all() + rimports = RecurrentImport.objects.order_by("name__unaccent").all() context = { "title": "À propos", "static_content": "about", "url_path": reverse_lazy("about"), "rimports": rimports } return render(request, 'agenda_culturel/page-rimports-list.html', context) @@ -1090,7 +1090,7 @@ class ModerationAnswerDeleteView(PermissionRequiredMixin, DeleteView): class PlaceListView(ListView): model = Place paginate_by = 10 - ordering = ['name'] + ordering = ['name__unaccent'] class PlaceDetailView(DetailView):