from django.shortcuts import render

from rest_framework.viewsets import ModelViewSet
from .models import TEntBaseInfo
from .serializers import StandardSerializer, ImplementRuleSerializer, UnitTypeSerializer
# Create your views here.
class EntBaseInfoViewSet(ModelViewSet):
    perms_map = {'get': '*', 'post': 'standard_create',
                 'put': 'standard_update', 'delete': 'standard_delete'}
    queryset = Standard.objects
    serializer_class = StandardSerializer
    search_fields = ['name', 'code', 'status', 'implement_date']
    filterset_fields = ['status']
    ordering = ['-create_time']