mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 09:58:23 +02:00
Split API in each app
This commit is contained in:
35
apps/activity/api/serializers.py
Normal file
35
apps/activity/api/serializers.py
Normal file
@ -0,0 +1,35 @@
|
||||
# -*- mode: python; coding: utf-8 -*-
|
||||
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from ..models import ActivityType, Activity, Guest
|
||||
from rest_framework import serializers
|
||||
|
||||
class ActivityTypeSerializer(serializers.ModelSerializer):
|
||||
"""
|
||||
REST API Serializer for Activity types.
|
||||
The djangorestframework plugin will analyse the model `ActivityType` and parse all fields in the API.
|
||||
"""
|
||||
class Meta:
|
||||
model = ActivityType
|
||||
fields = '__all__'
|
||||
|
||||
|
||||
class ActivitySerializer(serializers.ModelSerializer):
|
||||
"""
|
||||
REST API Serializer for Activities.
|
||||
The djangorestframework plugin will analyse the model `Activity` and parse all fields in the API.
|
||||
"""
|
||||
class Meta:
|
||||
model = Activity
|
||||
fields = '__all__'
|
||||
|
||||
|
||||
class GuestSerializer(serializers.ModelSerializer):
|
||||
"""
|
||||
REST API Serializer for Guests.
|
||||
The djangorestframework plugin will analyse the model `Guest` and parse all fields in the API.
|
||||
"""
|
||||
class Meta:
|
||||
model = Guest
|
||||
fields = '__all__'
|
Reference in New Issue
Block a user