[Fixed]-Django โ€“ update single entry in form from Model

1๐Ÿ‘

โœ…

You have made the grp_ana field the primary key; that means you should not ever change the value. If you do, of course it means an insert rather than an update: the pk is how a record is identified in the first place, and Django has no way of associating a model instance with a database row other than via the pk.

Generally you should let Django define an auto incrementing pk anyway; particularly in your case, when you want to edit the field, you should not make it the pk.

๐Ÿ‘คDaniel Roseman

Leave a comment