我正在尝试为我的响应添加一个不在我的模型字段中的值。例如,请看下面的代码
for Me in Sections:
Parts = Part.objects.filter(Section=Me.id)
for Me in Parts:
FieldCount = Field.objects.filter(Req=True, Visible=True, Part=Me.id).count()
Counter += FieldCount
RequiredField = {'FieldsRequired': Counter}
serializer = ApplicationSerializer(App)
return Response(RequiredField)
我希望能够在响应中发送serializer.data,在响应中发送RequiredField。