阅读背景:

如何在使用ModelForms时更新已经存在的行?

来源:互联网 

I have a question on how to update an existing row in my database when one of the fields is my primary key. I am using ModelForm and Django-Piston - my main goal here is to have RESTful Post send to my webservice. I am able to have initial Posts be sent correctly (i.e. that Primary key value doesn't exist yet). The problem is when I want to update a value where the Primary key already exists - when I issue a f.is_valid() it fails because "this UniqueIdentifier already exists". How can I do form validation using ModelForms to update an existing row?I have a question on how to update an existing




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

分享到: