FastAPI | SqlAlchemy / Pydantic Attribute Error on Relationship
Given the SqlAlchemy models where I defined a FK relation between business_partner_table and users_table
Why am I getting HTTP error 422 Unprocessable Entity
I have written this endpoint:
File “uvloop/loop.pyx”, line 1978, in create_connection socket.gaierror: [Errno -2]
I am working with FastAPI. Previously, my DATABASE_URL in db.py was constructed using an f-string from the settings instance.
Trying to create a one-to-many relationship in both directions
All, thanks for taking the time to help. Basically, I have a table called Task that has a one-to-many relationship with a table called Label. This works just fine. I can assign every label I create to a task ID and then I can query labels by the task id. But I would also like to have a one-to-many relationship in reverse so every label can have a relationship with all tasks. Hope that makes sense. This is all pretty new to me so maybe I’m going about it all wrong. Maybe I’m making it too complicated and should remove all relationships and just create a column in each table that stores the information. I was hoping to take advantage of some of the things that come with having a relationship though.