feat: batchst返回material_start相关信息
This commit is contained in:
parent
a249258ba6
commit
9d1c5415e1
|
@ -1464,6 +1464,9 @@ class MlogTCreateSerializer(CustomModelSerializer):
|
||||||
|
|
||||||
|
|
||||||
class BatchStSerializer(CustomModelSerializer):
|
class BatchStSerializer(CustomModelSerializer):
|
||||||
|
material_start_name = serializers.CharField(source='material_start.name', read_only=True)
|
||||||
|
material_start_model = serializers.CharField(source='material_start.model', read_only=True)
|
||||||
|
material_start_specification = serializers.CharField(source='material_start.specification', read_only=True)
|
||||||
class Meta:
|
class Meta:
|
||||||
model = BatchSt
|
model = BatchSt
|
||||||
fields = "__all__"
|
fields = "__all__"
|
||||||
|
|
|
@ -901,6 +901,7 @@ class BatchStViewSet(ListModelMixin, ComplexQueryMixin, CustomGenericViewSet):
|
||||||
perms_map = {"get": "*"}
|
perms_map = {"get": "*"}
|
||||||
queryset = BatchSt.objects.all()
|
queryset = BatchSt.objects.all()
|
||||||
serializer_class = BatchStSerializer
|
serializer_class = BatchStSerializer
|
||||||
|
select_related_fields = ["material_start"]
|
||||||
ordering_fields = ["batch", "last_time", "update_time"]
|
ordering_fields = ["batch", "last_time", "update_time"]
|
||||||
ordering = ["batch"]
|
ordering = ["batch"]
|
||||||
filterset_class = BatchStFilter
|
filterset_class = BatchStFilter
|
||||||
|
|
Loading…
Reference in New Issue