Skip to content

Commit 7e7ef67

Browse files
committed
feat(controller): add search apps api
1 parent 8af4789 commit 7e7ef67

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

rootfs/api/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from guardian.shortcuts import assign_perm, get_objects_for_user, \
1515
get_users_with_perms, remove_perm
1616
from django.views.generic import View
17-
from rest_framework import renderers, status
17+
from rest_framework import renderers, status, filters
1818
from rest_framework.exceptions import PermissionDenied, NotFound
1919
from rest_framework.permissions import IsAuthenticated, AllowAny
2020
from rest_framework.response import Response
@@ -221,6 +221,8 @@ def get_object(self):
221221
class AppViewSet(BaseDryccViewSet):
222222
"""A viewset for interacting with App objects."""
223223
model = models.App
224+
filter_backends = [filters.SearchFilter]
225+
search_fields = ['^id', ]
224226
serializer_class = serializers.AppSerializer
225227

226228
def get_queryset(self, *args, **kwargs):

0 commit comments

Comments
 (0)