# coding=utf-8


from rest_framework import serializers
from .models import MaintOrderReserve

class MaintOrderReserveSerializer(serializers.ModelSerializer):
    shop_name = serializers.CharField(source='shop.name', read_only=True)
    model_name = serializers.CharField(source='vehicle.model', read_only=True)
    customer_name = serializers.CharField(source='customer.name', read_only=True)
    status_text = serializers.CharField(source='get_status_display', read_only=True)
    create_time = serializers.DateTimeField(format='%Y-%m-%d %H:%M', read_only=True)
    date = serializers.DateField(format='%Y-%m-%d')

    class Meta:
        model = MaintOrderReserve
        fields = '__all__'

