📜  获取最后保存 id django 模型 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:52.202000             🧑  作者: Mango

代码示例1
latest_id = models.objects.latest('id').id
# check last id then do something with that then.
latest_id = Entry.objects.latest('id')

# source
https://docs.djangoproject.com/en/3.2/ref/models/querysets/#latest