from rest_framework import viewsets
from clinic.models import Patient
from clinic.serializers import PatientSerializer


class PatientViewSet(viewsets.ModelViewSet):
    queryset = Patient.objects.all()
    serializer_class = PatientSerializer

    def get_queryset(self):
        user = self.request.user
        return user.patients.all()

e49afdb14a4962cfe10ad72d102b4824a97ea703
<mask token>


class PatientViewSet(viewsets.ModelViewSet):
    <mask token>
    <mask token>
    <mask token>

<mask token>


class PatientViewSet(viewsets.ModelViewSet):
    <mask token>
    <mask token>

    def get_queryset(self):
        user = self.request.user
        return user.patients.all()

<mask token>


class PatientViewSet(viewsets.ModelViewSet):
    queryset = Patient.objects.all()
    serializer_class = PatientSerializer

    def get_queryset(self):
        user = self.request.user
        return user.patients.all()

from rest_framework import viewsets
from clinic.models import Patient
from clinic.serializers import PatientSerializer


class PatientViewSet(viewsets.ModelViewSet):
    queryset = Patient.objects.all()
    serializer_class = PatientSerializer

    def get_queryset(self):
        user = self.request.user
        return user.patients.all()
