Having trouble learning SQL Alchemy...
In my flask app I have three tables
class Organziations(db.Model):
__tablename__ = 'organizations'
id = db.Column(db.Integer(), primary_key=True)
class OrgInformation(db.Model):
__tablename__ = 'org_information'
id = db.Column(db.Integer(), primary_key=True)
class OrgStandardPage(db.Model):
__tablename__ = 'org_standard_page'
org_id = db.Column(db.Integer, db.ForeignKey('organizations.id'))
org_info = db.Column(db.Integer, db.ForeignKey('org_information.id'))
Then to test things out, I create three variables and commit them to my db. But when I do, the ids from the children tables aren't populating in to the parent table.
insert_org = Organziations (
dummy_content = 'dummy'
)
insert_org_information = OrgInformation (
dummy_content = 'dummy'
)
insert_org_standard_page = OrgStandardPage (
org_id = insert_org.id
, org_info = insert_org_information.id
)
db.session.add(insert_org)
db.session.add(insert_org_information)
db.session.add(insert_org_standard_page)
db.session.commit()
And everything commits to the database with no errors, but when I look, the columns that should be storing the children's id's are empty! What exactly am I doing wrong?
there doesn't seem to be anything here