Closed GaretJax closed 10 years ago
This line https://github.com/ITCase/sqlalchemy_mptt/blob/master/sqlalchemy_mptt/events.py#L65 should probably be something along the lines of:
tree_id = connection.scalar(select([func.max(table.c.tree_id) + 1])) or 1
Right now, the first parentless item is inserted with a tree_id of 1, but from the second on they are all set to 2.
This line https://github.com/ITCase/sqlalchemy_mptt/blob/master/sqlalchemy_mptt/events.py#L65 should probably be something along the lines of:
Right now, the first parentless item is inserted with a tree_id of 1, but from the second on they are all set to 2.