答案 0 :(得分:4)
我刚刚找到了字边界
的解决方案 <强> def edit_recording(request,slug, recording_id):
recording = get_object_or_404(Recording, pk=recording_id)
if request.method == "POST":
form = RecordingForm(request.POST, instance=recording)
if form.is_valid():
recording = form.save(commit=False)
recording.save()
return redirect('data:detail')
else:
form = RecordingForm(instance=recording)
template = 'data/create_recording.html'
context = {'form': form}
return render(request, template, context)
强>
这就是诀窍。
答案 1 :(得分:2)
您可以对这些样本使用fu(?!.)
。你甚至可以省略f
以获得更好的分数。