An implementation for SQLAlchemy-based applications of the nested-sets/modified-pre-order-tree-traversal technique for storing hierarchical data in a relational database.
Other
54
stars
10
forks
source link
Issues when primary column name differs from mapper attribute name #25
That is, the name in the database is "page", but the name in the mapper is "id". This is not handled right:
File "/Users/michael/Development/checkouts/sqlalchemy-orm-tree/sqlalchemy_tree/orm.py", line 116, in before_insert
self._reload_tree_parameters(connection, node, target)
File "/Users/michael/Development/checkouts/sqlalchemy-orm-tree/sqlalchemy_tree/orm.py", line 59, in _reload_tree_parameters
node_pk = getattr(node, options.pk_field.name)
AttributeError: 'Page' object has no attribute 'page'
I have this in a node:
That is, the name in the database is "page", but the name in the mapper is "id". This is not handled right: