mirror of https://gitlab.crans.org/bde/nk20
47 lines
1.1 KiB
Python
47 lines
1.1 KiB
Python
|
from .models import Profile, Club, Role, Membership
|
||
|
from rest_framework import serializers, viewsets
|
||
|
|
||
|
class ProfileSerializer(serializers.HyperlinkedModelSerializer):
|
||
|
class Meta:
|
||
|
model = Profile
|
||
|
fields = '__all__'
|
||
|
|
||
|
|
||
|
class ProfileViewSet(viewsets.ModelViewSet):
|
||
|
queryset = Profile.objects.all()
|
||
|
serializer_class = ProfileSerializer
|
||
|
|
||
|
|
||
|
class ClubSerializer(serializers.HyperlinkedModelSerializer):
|
||
|
class Meta:
|
||
|
model = Club
|
||
|
fields = '__all__'
|
||
|
|
||
|
|
||
|
class ClubViewSet(viewsets.ModelViewSet):
|
||
|
queryset = Club.objects.all()
|
||
|
serializer_class = ClubSerializer
|
||
|
|
||
|
|
||
|
class RoleSerializer(serializers.HyperlinkedModelSerializer):
|
||
|
class Meta:
|
||
|
model = Role
|
||
|
fields = '__all__'
|
||
|
|
||
|
|
||
|
class RoleViewSet(viewsets.ModelViewSet):
|
||
|
queryset = Role.objects.all()
|
||
|
serializer_class = RoleSerializer
|
||
|
|
||
|
|
||
|
class MembershipSerializer(serializers.HyperlinkedModelSerializer):
|
||
|
class Meta:
|
||
|
model = Membership
|
||
|
fields = '__all__'
|
||
|
|
||
|
|
||
|
class MembershipViewSet(viewsets.ModelViewSet):
|
||
|
queryset = Membership.objects.all()
|
||
|
serializer_class = MembershipSerializer
|
||
|
|