2023-04-16 14:34:45 +02:00
|
|
|
from rest_framework import generics
|
2023-04-16 12:20:37 +02:00
|
|
|
|
2023-04-16 13:21:57 +02:00
|
|
|
from help.models import HelpUser
|
2023-04-16 13:50:01 +02:00
|
|
|
from help.serializers import HelpUserSerializer
|
2023-04-16 13:21:57 +02:00
|
|
|
|
|
|
|
|
2023-04-16 14:34:45 +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.
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
2023-04-16 14:34:45 +02:00
|
|
|
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
|