Django Book 翻译
菜单>:
TOC
返回
原文:
If you assign auto-primary-key values manually, make sure not to use an already existing primary key value! If you create a new object with an explicit primary key value that already exists in the database, Django will assume youre changing the existing record rather than creating a new one.
翻译:
如果你手动指定自增主键的值,要确保这个主键在数据库中不存在!如果你显式地指定主键来创建新对象,而这个主键在数据库中已经存在的话,Django会认为你要更改已经存在的那条记录,而不是创建一个新的。
备注:
译者: