From a2f54d48a791de79d5d2dd631581b87478f95ce3 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Thu, 12 Mar 2020 01:10:52 +0100 Subject: [PATCH] Improve a lot the interface --- apps/note/api/views.py | 5 +- templates/note/conso_form.html | 146 ++++++++++++++++++++++++--------- 2 files changed, 108 insertions(+), 43 deletions(-) diff --git a/apps/note/api/views.py b/apps/note/api/views.py index 14f64003..cace7e40 100644 --- a/apps/note/api/views.py +++ b/apps/note/api/views.py @@ -82,8 +82,7 @@ class NotePolymorphicViewSet(viewsets.ModelViewSet): elif "club" in types: queryset = queryset.filter(polymorphic_ctype__model="noteclub") elif "special" in types: - queryset = queryset.filter( - polymorphic_ctype__model="notespecial") + queryset = queryset.filter(polymorphic_ctype__model="notespecial") else: queryset = queryset.none() @@ -98,6 +97,8 @@ class AliasViewSet(viewsets.ModelViewSet): """ queryset = Alias.objects.all() serializer_class = AliasSerializer + filter_backends = [SearchFilter] + search_fields = ['$normalized_name', '$name', '$note__polymorphic_ctype__model', ] def get_queryset(self): """ diff --git a/templates/note/conso_form.html b/templates/note/conso_form.html index 7179fc58..35c2ab82 100644 --- a/templates/note/conso_form.html +++ b/templates/note/conso_form.html @@ -31,12 +31,9 @@
- + +
@@ -79,10 +76,10 @@
{% for button in category.list %} {% if button.display %} - + {% endif %} {% endfor %}
@@ -145,12 +142,14 @@