gva/gnuviechadmin/help/views.py

27 lines
632 B
Python
Raw Permalink Normal View History

from rest_framework import generics
2023-04-16 13:21:57 +02:00
from help.models import HelpUser
from help.serializers import HelpUserSerializer
2023-04-16 13:21:57 +02:00
class ListHelpUserAPIView(generics.ListAPIView):
2023-04-16 13:21:57 +02:00
"""
API endpoint that allows user help profile to be viewed or edited.
"""
queryset = (
HelpUser.objects.all().prefetch_related("user").order_by("user__username")
)
serializer_class = HelpUserSerializer
class HelpUserAPIView(generics.RetrieveUpdateAPIView):
"""
API endpoint that allows user help profile to be viewed or edited.
"""
queryset = HelpUser.objects.all()
2023-04-16 13:21:57 +02:00
serializer_class = HelpUserSerializer