feat: 获取标签明细3

This commit is contained in:
caoqianming 2024-10-11 15:41:55 +08:00
parent ef28e1ba47
commit 0157daa0ab
1 changed files with 3 additions and 2 deletions

View File

@ -5,13 +5,14 @@ from apps.cm.serializers import TidSerializer, LabelMatSerializer
from apps.inm.models import MaterialBatch
from rest_framework.exceptions import ParseError
from rest_framework.response import Response
from apps.utils.viewsets import CustomGenericViewSet, RetrieveModelMixin
from apps.utils.viewsets import CustomGenericViewSet, RetrieveModelMixin, CustomListModelMixin
# Create your views here.
class LableMatViewSet(RetrieveModelMixin, CustomGenericViewSet):
class LableMatViewSet(CustomListModelMixin, RetrieveModelMixin, CustomGenericViewSet):
perms_map = {"post": "*", "get": "*"}
serializer_class = LabelMatSerializer
queryset = LableMat.objects.all()
select_related_fields = ["material", "material_origin", "supplier"]
@action(methods=['post'], detail=False, serializer_class=TidSerializer)
def get_from_mb(self, request, pk=None):