You can also use the library https://github.com/uralbash/sqlalchemy_mptt


пятница, 21 июля 2017 г., 20:40:57 UTC+5 пользователь Nathan Mooth написал:
>
> So I have a tree-like data structure that I need to store in a way so that 
> I can see all children or all parents of a query as well as their relative 
> depth from the query item. In the past I have been using the closure table 
> method demonstrated in this blog post 
> <http://dirtsimple.org/2010/11/simplest-way-to-do-tree-based-queries.html>, 
> however now that I am switching to sqlAlchemy I am wondering if there is a 
> better way to do this. So basically I am trying to figure out how to run a 
> series of inserts on my closure table whenever an item is added to the main 
> table, as well as what would be the best way to load the child or parent 
> items of a query.
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to