Re: [sqlalchemy] Best practices for sub-dividing a large collection relationship

2021-12-30 Thread Dane K Barney
Hey Mike, thanks for your speedy reply. I guess I left out some key details and simplified my examples a little too much, which is probably why you're confused. For one, I have actually implemented downstream_edges and upstream_edges as dictionary collections, i.e.: src_node = relationship(

Re: [sqlalchemy] Best practices for sub-dividing a large collection relationship

2021-12-30 Thread Mike Bayer
On Thu, Dec 30, 2021, at 8:10 PM, Dane K Barney wrote: > Given the following example model: > > class Node(Base): > __tablename__ = "node" > id = Column(Integer, primary_key=True, autoincrement=True) > > class Edge(Base): > __tablename__ = "edge" > id = Column(Integer,

[sqlalchemy] Best practices for sub-dividing a large collection relationship

2021-12-30 Thread Dane K Barney
Given the following example model: class Node(Base): __tablename__ = "node" id = Column(Integer, primary_key=True, autoincrement=True) class Edge(Base): __tablename__ = "edge" id = Column(Integer, primary_key=True, autoincrement=True) color = Column(Enum(Color))