method

id

id()
public

A model instance’s primary key is always available as model.id whether you name it the default ‘id’ or set it to something else.