阅读背景:

设置不属于ModelForm的Model字段的值?

来源:互联网 

I have a ModelForm which has a subset of fields of the model it is for. When I'm processing that form, checking is_valid etc, I want to check the value of a given field that may have changed, so I check if form.has_changed() and then I check if myfield in form.changed_data. If that is true, I want to set the value for a field on my model, but that field is NOT on this modelform. How might I go about doing that? I have a ModelForm which has a subset of fields




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: