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
{{ message }}
Repository navigation
Establish relationship using Relationship feature in Postgres #141
I have two different models CreateUnitType, CreateUnit attached with unit_type_id field as foreign key to CreateUnitType table and the whole database is in postgres. I want to establish the Relationship feature but somehow whenever I try to run the query I get this following error -
AttributeError: Could not locate column in row for column '_sa_instance_state'
I'm not sure what exactly the problem with your code is. One small issue is that you're instantiating db_unit before you've declared CreateUnit. I've used the code below to try to replicate and I was unsuccessful:
Activity
JLHasson commentedon Oct 26, 2021
I'm not sure what exactly the problem with your code is. One small issue is that you're instantiating
db_unitbefore you've declaredCreateUnit. I've used the code below to try to replicate and I was unsuccessful:Output:
Granted I tested this with a SQLite DB but I'm not sure that it should make a different (afaik Postgres should behave the same way).
Can you try the code I've pasted above and let me know if it works for you?