uncloud/uncloud_django_based/uncloud/uncloud_auth/serializers.py
2020-04-02 19:31:03 +02:00

15 lines
456 B
Python

from django.contrib.auth import get_user_model
from rest_framework import serializers
from uncloud import AMOUNT_DECIMALS, AMOUNT_MAX_DIGITS
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = get_user_model()
fields = ['username', 'email', 'balance', 'maximum_credit' ]
balance = serializers.DecimalField(max_digits=AMOUNT_MAX_DIGITS,
decimal_places=AMOUNT_DECIMALS)