I cannot get the last insert id, as usual, and I'm not sure why.
In my opinion:
comment = Comments( ...)
comment.save()
comment.id
In my model:
class Comments(models.Model):
id = models.IntegerField(primary_key=True)
Has anyone encountered this problem before? Usually, after calling the save () method, I have access to id via comment.id, but this time it does not work.
source
share