2020-02-27 10:59:28 +00:00
|
|
|
from rest_framework import serializers
|
|
|
|
from .models import Bill, Payment
|
|
|
|
|
|
|
|
class BillSerializer(serializers.ModelSerializer):
|
|
|
|
class Meta:
|
|
|
|
model = Bill
|
2020-02-27 11:21:25 +00:00
|
|
|
fields = ['owner', 'amount', 'due_date', 'creation_date', 'starting_date', 'ending_date', 'paid']
|
2020-02-27 10:59:28 +00:00
|
|
|
|
|
|
|
class PaymentSerializer(serializers.ModelSerializer):
|
|
|
|
class Meta:
|
|
|
|
model = Payment
|
2020-02-27 11:10:26 +00:00
|
|
|
fields = ['owner', 'amount', 'source', 'timestamp']
|