1
爲什麼我不能在我的未綁定模型表單中設置instance = None
?設置modelForm實例的初始值
def sample(request):
prf_form = ProfileForm(instance=None)
print prf_form.instance #debugger print
return render_to_response(template, locals(), context_instance=RequestContext(request))
我得到以下異常:DoesNotExist