perf: 修改 labels 绑定引起的问题

This commit is contained in:
ibuler
2023-12-19 18:42:44 +08:00
committed by Bryan
parent 45425b11d2
commit 0b7552a6ee
8 changed files with 28 additions and 10 deletions

View File

@@ -42,7 +42,7 @@ class LabeledResourceSerializer(serializers.ModelSerializer):
res_type = LabeledChoiceField(
choices=[], label=_("Resource type"), source='res_type_id', required=False
)
label = ObjectRelatedField(queryset=Label.objects, attrs=('name', 'value'), label=_("Label"))
label = ObjectRelatedField(queryset=Label.objects, attrs=('id', 'display_name'), label=_("Label"))
resource = serializers.CharField(label=_("Resource"))
class Meta: