I need to create an SQLAlchemy version of a linked list. It\'s actually more complex than that, but it boils down to this:
I need a one-to-one, self-referential,
As exception says you need to set remote_side keyword for relationship. Otherwise sqlalchemy cannot select reference direction.
remote_side
class Node(declarative_base()): ... prev = relationship( 'Node', uselist=False, remote_side=[id], backref=backref('next', uselist=False) )