Skip to content

Commit

Permalink
change fields for filter and search
Browse files Browse the repository at this point in the history
  • Loading branch information
muhuchah committed Jun 21, 2024
1 parent 175e824 commit a8296e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Karoo_BackEnd/Karoo_BackEnd/job_module/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,11 @@ def perform_create(self, serializer):
class jobListAPIView(generics.ListAPIView):
serializer_class = joblistSerializer
filter_backends = [DjangoFilterBackend, filters.SearchFilter]
filterset_fields = ['SubCategory__title', 'SubCategory__MainCategory__title', 'user__addresses__city__name', 'user__addresses__province__name']
filterset_fields = ['SubCategory__title', 'SubCategory__MainCategory__title', 'user__addresses__province__name',
'province__name', 'city__name']
search_fields = [
'title', 'user__full_name', 'SubCategory__title', 'SubCategory__MainCategory__title', 'user__addresses__city__name', 'user__addresses__province__name']
'title', 'user__full_name', 'SubCategory__title', 'SubCategory__MainCategory__title', 'province__name',
'city__name']
queryset = job.objects.all()

def list(self, request, *args, **kwargs):
Expand Down

0 comments on commit a8296e7

Please sign in to comment.