Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get last save id django model

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
 
PREVIOUS NEXT
Tagged: #save #id #django #model
ADD COMMENT
Topic
Name
7+7 =