Flask-SqlAlchemy Adjacency List Relationship backfref unexpected error
You configure the relationship in a wrong way. Please do this one:
from sqlalchemy.orm import backrefclass Node(db.Model): # ... children = db.relationship('Node', backref=backref('parent', remote_side=[id]))
or
class Node(db.Model): # ... parent = db.relationship("Node", backref='children', remote_side=[id])