1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-20 17:41:55 +02:00

Improve a lot the interface

This commit is contained in:
Yohann D'ANELLO
2020-03-12 01:10:52 +01:00
parent f748f533b2
commit a2f54d48a7
2 changed files with 108 additions and 43 deletions

View File

@ -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):
"""