uncloud-mravi/uncloud/uncloud_pay/serializers.py

12 lines
352 B
Python

from rest_framework import serializers
from .models import Bill, Payment
class BillSerializer(serializers.ModelSerializer):
class Meta:
model = Bill
fields = ['user', 'amount']
class PaymentSerializer(serializers.ModelSerializer):
class Meta:
model = Payment
fields = ['user', 'amount', 'source', 'timestamp']