HiPhone_BE/graph/serializers.py

17 lines
454 B
Python
Raw Normal View History

2023-06-23 02:09:00 +09:00
# from rest_framework import serializers
from rest_framework.serializers import ModelSerializer
from graph.models import Transaction, MonthlyTransaction
class TransactionSerializer(ModelSerializer):
class Meta:
model = Transaction
fields = ("id", "product", "price", "created_at")
class MonthlyTransactionSerializer(ModelSerializer):
class Meta:
model = MonthlyTransaction
fields = ("year", "month", "price")