gva/gnuviechadmin/help/serializers.py

23 lines
488 B
Python
Raw Normal View History

2023-04-16 13:21:57 +02:00
"""
Serializers for the REST API
"""
from rest_framework import serializers
from help.models import HelpUser
class HelpUserSerializer(serializers.HyperlinkedModelSerializer):
user = serializers.StringRelatedField()
2023-04-16 13:21:57 +02:00
class Meta:
model = HelpUser
fields = [
"url",
"user",
"email_address",
"postal_address",
"offline_account_code",
]
read_only_fields = ["user", "offline_account_code"]