You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm sure this must be answered somewhere, but I'm utterly failing at coming up with a working solution.
I have a flask app that utilizes blueprints. There is a main models.py file with a Users class. The table for this ends up in the onea database.
I then have a blueprint called monitoring with its own schema (called "monitoring"...). One of the tables in the monitoring schema (MonitoringAssignedTo) has a foreign_key relationship with the Users table in the main schema.
I'm unsure as to how I'm supposed to import the Users class into monitoring so I can have that foreign key relationship across schemas. I'm assuming I have to use reflection, but I don't understand how.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm sure this must be answered somewhere, but I'm utterly failing at coming up with a working solution.
I have a flask app that utilizes blueprints. There is a main models.py file with a
Users
class. The table for this ends up in theonea
database.I then have a blueprint called
monitoring
with its own schema (called "monitoring"...). One of the tables in the monitoring schema (MonitoringAssignedTo
) has a foreign_key relationship with theUsers
table in the main schema.I'm unsure as to how I'm supposed to import the
Users
class into monitoring so I can have that foreign key relationship across schemas. I'm assuming I have to use reflection, but I don't understand how.app/models.py
app/blueprints/monitoring/models.py
my config file:
Beta Was this translation helpful? Give feedback.
All reactions