Django: Only update fields that have been changed in UpdateView

后端 未结 2 1583
暖寄归人
暖寄归人 2021-01-06 06:46

I\'m using an UpdateView to update a series of fields. However, I only want fields that have been modified to be saved to the database. If a value was not provided for a fie

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-06 07:35

    The easiest way would be to pre-populate the fields with what's already there. Do this on the template with {{ account.name }} or whatever.

提交回复
热议问题