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):
|
2023-04-16 13:50:01 +02:00
|
|
|
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"]
|