hberp/hb_server/apps/pm/serializers.py

16 lines
523 B
Python

from apps.pm.models import ProductionPlan
from rest_framework import serializers
from apps.sam.serializers import OrderSerializer
class ProductionPlanCreateFromOrderSerializer(serializers.ModelSerializer):
class Meta:
model = ProductionPlan
fields = ['order', 'number', 'count', 'start_date', 'end_date']
class ProductionPlanSerializer(serializers.ModelSerializer):
order_ = OrderSerializer(source='order', read_only=True)
class Meta:
model = ProductionPlan
fields ='__all__'