Fix primary key identification

_primary_key_name was finding the table column name, however it should
find the attribute name of the model