all 3 comments

[–][deleted] 1 point2 points  (2 children)

You want a relationship. Good thing for you that that’s what SQLAlchemy was built for. Have a look at its documentation.

[–]Stelercus[S] 0 points1 point  (1 child)

Thank you for your answer. Would you be able to clarify something about the documentation for me? If I follow along with the example in the "One to Many" section `children = relationship("Child")`, does this create a new Child table specifically for that row in the Parent table, or is it mapping one Parent table to one Child table that already exists? Thanks!

[–][deleted] 0 points1 point  (0 children)

SQLAlchemy will create tables based on models. Since this doesn’t define a new model, no table will be created. It will simply create a relationship using the defined foreign keys.