XH_Digital_Management/application/rsc_mgnt/serializers.py

21 lines
784 B
Python

from rest_framework import serializers
from .models import *
class ConsumableGoodsInboundSerializer(serializers.ModelSerializer):
category = serializers.PrimaryKeyRelatedField(queryset=ConsumableGoodsCategory.objects.all())
inventory = serializers.PrimaryKeyRelatedField(queryset=ConsumableGoodsInventory.objects.all())
class Meta:
model = ConsumableGoodsInboundManagement
fields = '__all__'
class ConsumableGoodsOutboundSerializer(serializers.ModelSerializer):
category = serializers.PrimaryKeyRelatedField(queryset=ConsumableGoodsCategory.objects.all())
inventory = serializers.PrimaryKeyRelatedField(queryset=ConsumableGoodsInventory.objects.all())
class Meta:
model = ConsumableGoodsOutboundRecords
fields = '__all__'