- 论坛徽章:
- 0
|
文档链接:https://docs.djangoproject.com/e ... ms/#the-save-method
里面有这么一句话:
Django will prevent any attempt to save an incomplete model, so if the model does not allow the missing fields to be empty, and does not provide a default value for the missing fields, any attempt to save() a ModelForm with missing fields will fail. To avoid this failure, you must instantiate your model with initial values for the missing, but required fields:
author = Author(title='Mr')
form = PartialAuthorForm(request.POST, instance=author)
form.save()
这个例子中missing fields是哪一个? |
|