mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-07-22 16:56:48 +02:00
ansible
apps
activity
api
food
logs
member
api
__init__.py
serializers.py
urls.py
views.py
migrations
static
templates
templatetags
tests
__init__.py
admin.py
apps.py
auth.py
forms.py
hashers.py
models.py
signals.py
tables.py
urls.py
views.py
note
permission
registration
scripts
treasury
wei
wrapped
docs
locale
note_kfet
.dockerignore
.env_example
.gitignore
.gitlab-ci.yml
.gitmodules
COPYING
Dockerfile
README.md
entrypoint.sh
manage.py
nginx_note.conf_example
note.cron
requirements.txt
tox.ini
uwsgi_note.ini
41 lines
1.0 KiB
Python
41 lines
1.0 KiB
Python
# Copyright (C) 2018-2025 by BDE ENS Paris-Saclay
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
from rest_framework import serializers
|
|
|
|
from ..models import Profile, Club, Membership
|
|
|
|
|
|
class ProfileSerializer(serializers.ModelSerializer):
|
|
"""
|
|
REST API Serializer for Profiles.
|
|
The djangorestframework plugin will analyse the model `Profile` and parse all fields in the API.
|
|
"""
|
|
|
|
class Meta:
|
|
model = Profile
|
|
fields = '__all__'
|
|
read_only_fields = ('user', )
|
|
|
|
|
|
class ClubSerializer(serializers.ModelSerializer):
|
|
"""
|
|
REST API Serializer for Clubs.
|
|
The djangorestframework plugin will analyse the model `Club` and parse all fields in the API.
|
|
"""
|
|
|
|
class Meta:
|
|
model = Club
|
|
fields = '__all__'
|
|
|
|
|
|
class MembershipSerializer(serializers.ModelSerializer):
|
|
"""
|
|
REST API Serializer for Memberships.
|
|
The djangorestframework plugin will analyse the model `Memberships` and parse all fields in the API.
|
|
"""
|
|
|
|
class Meta:
|
|
model = Membership
|
|
fields = '__all__'
|