'Gets a related object off of a relationship.
Raises a runtime error if the relationship isn\'t configured correctly
for revision bumping.'

def _find_related_obj(self, session, obj, relationship_col):

    related_obj = getattr(obj, relationship_col)
    if related_obj:
        return related_obj
    for rel in sqlalchemy.inspect(obj).mapper.relationships:
        if (rel.key != relationship_col):
            continue
        if (not rel.load_on_pending):
            raise RuntimeError(_('revises_on_change    relationships    must    have    load_on_pending    set    to    True    to    bump    parent    revisions    on    create:    %s'), relationship_col)
