Skip to content

Commit

Permalink
Added a filter to retrieve archived projects (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevildude authored Sep 11, 2023
1 parent b93d63c commit b31c90a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ayushma/views/project.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.conf import settings
from django_filters.rest_framework import DjangoFilterBackend
from drf_spectacular.utils import extend_schema, extend_schema_view
from rest_framework import filters
from rest_framework.mixins import CreateModelMixin, ListModelMixin, RetrieveModelMixin
Expand All @@ -19,8 +20,9 @@ class ProjectViewSet(
CreateModelMixin,
):
queryset = Project.objects.all()
filter_backends = (filters.SearchFilter,)
filter_backends = (filters.SearchFilter, DjangoFilterBackend)
search_fields = ("title",)
filterset_fields = ("archived",)
serializer_class = ProjectSerializer
permission_classes = (IsAdminUser,)
permission_action_classes = {
Expand Down

0 comments on commit b31c90a

Please sign in to comment.