Get pk values from object

        :param obj: sqlalchemy object

def _pk(self, obj):
        """Get pk values from object

        :param obj: sqlalchemy object
        """
        pk_values = tuple(getattr(obj, c.name)
                          for c in obj.__mapper__.primary_key)
        if len(pk_values) == 1:
            return pk_values[0]
        return pk_values