可以Add assignee to web UI (at Change Info section)”翻译为“在更改信息部分添加受让人”,解决方法如下:
def change_info(request, id): task = Task.objects.get(id=id) if request.method == 'POST': # 更新任务信息 ... # 添加受让人到更改信息中 assignee = request.POST.get('assignee') ChangeInfo.objects.create( task=task, message=f'受让人已添加:{assignee}' ) return redirect('tasks:detail', id=id) else: context = {'task': task} return render(request, 'change_info.html', context)