plateforme-tfjm2/apps/registration/api/views.py

16 lines
513 B
Python

# Copyright (C) 2020 by Animath
# SPDX-License-Identifier: GPL-3.0-or-later
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.viewsets import ModelViewSet
from .serializers import RegistrationSerializer
from ..models import Registration
class RegistrationViewSet(ModelViewSet):
queryset = Registration.objects.all()
serializer_class = RegistrationSerializer
filter_backends = [DjangoFilterBackend]
filterset_fields = ['user', 'participantregistration__team', ]