perf: execution automation ObjectRelatedField

pull/14982/head
feng 2025-03-07 17:04:04 +08:00 committed by feng626
parent 405344de74
commit 033750f108
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ class AutomationExecutionSerializer(serializers.ModelSerializer):
snapshot = serializers.SerializerMethodField(label=_('Automation snapshot'))
trigger = LabeledChoiceField(choices=Trigger.choices, read_only=True, label=_("Trigger mode"))
status = LabeledChoiceField(choices=Status.choices, read_only=True, label=_('Status'))
automation = ObjectRelatedField(read_only=True, attrs=('id', 'name'))
automation = ObjectRelatedField(required=False, queryset=BaseAutomation.objects, attrs=('id', 'name'))
class Meta:
model = AutomationExecution