def primary_key_names(model):
 mapper = sqlalchemy_inspect(model)
 return [column.name for column in mapper.primary_key]

def primary_key_names ( model ) : mapper = sqlalchemy_inspect ( model ) return [ column . name for column in mapper . primary_key ]
returns a list of all the primary keys for a model .