1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2024-11-26 21:27:11 +00:00

Use icontains rather than iregex in search field

This commit is contained in:
Yohann D'ANELLO 2020-09-25 15:10:27 +02:00
parent 7ed6b9712b
commit 4198ea8a72

View File

@ -107,7 +107,7 @@ class BDViewSet(viewsets.ModelViewSet):
serializer_class = BDSerializer
filter_backends = [DjangoFilterBackend, SearchFilter]
filterset_fields = ["isbn", "side_identifier"]
search_fields = ["isbn", "$title", "$subtitle", "side_identifier", "$authors__name"]
search_fields = ["=isbn", "title", "subtitle", "side_identifier", "authors__name"]
class MangaViewSet(viewsets.ModelViewSet):
@ -118,7 +118,7 @@ class MangaViewSet(viewsets.ModelViewSet):
serializer_class = MangaSerializer
filter_backends = [DjangoFilterBackend, SearchFilter]
filterset_fields = ["isbn", "side_identifier"]
search_fields = ["isbn", "$title", "$subtitle", "side_identifier", "$authors__name"]
search_fields = ["=isbn", "title", "subtitle", "side_identifier", "authors__name"]
class CDViewSet(viewsets.ModelViewSet):
@ -129,7 +129,7 @@ class CDViewSet(viewsets.ModelViewSet):
serializer_class = CDSerializer
filter_backends = [DjangoFilterBackend, SearchFilter]
filterset_fields = ["side_identifier"]
search_fields = ["$title", "side_identifier", "$authors__name"]
search_fields = ["title", "side_identifier", "authors__name"]
class VinyleViewSet(viewsets.ModelViewSet):
@ -140,7 +140,7 @@ class VinyleViewSet(viewsets.ModelViewSet):
serializer_class = VinyleSerializer
filter_backends = [DjangoFilterBackend, SearchFilter]
filterset_fields = ["side_identifier", "rpm"]
search_fields = ["$title", "side_identifier", "$authors__name"]
search_fields = ["title", "side_identifier", "authors__name"]
class RomanViewSet(viewsets.ModelViewSet):
@ -151,7 +151,7 @@ class RomanViewSet(viewsets.ModelViewSet):
serializer_class = RomanSerializer
filter_backends = [DjangoFilterBackend, SearchFilter]
filterset_fields = ["isbn", "side_identifier", "number_of_pages"]
search_fields = ["$title", "$subtitle", "side_identifier", "$authors__name"]
search_fields = ["=isbn", "title", "subtitle", "side_identifier", "authors__name"]
class RevueViewSet(viewsets.ModelViewSet):
@ -162,7 +162,7 @@ class RevueViewSet(viewsets.ModelViewSet):
serializer_class = RevueSerializer
filter_backends = [DjangoFilterBackend, SearchFilter]
filterset_fields = ["number", "year", "month", "day", "double"]
search_fields = ["$title"]
search_fields = ["title"]
class FutureMediaViewSet(viewsets.ModelViewSet):
@ -173,7 +173,7 @@ class FutureMediaViewSet(viewsets.ModelViewSet):
serializer_class = FutureMediaSerializer
filter_backends = [DjangoFilterBackend, SearchFilter]
filterset_fields = ["isbn"]
search_fields = ["$isbn"]
search_fields = ["=isbn"]
class EmpruntViewSet(viewsets.ModelViewSet):