r/FastAPI • u/Ok_Presentation3990 • Feb 27 '25
Question Gino, asyncpg in FastAPI
I have a fastapi microservice ERP , I recently changed my company_id to use UUID instead of Integer, but on trying to do a patch request I get this error:
{
"code": 3,
"errors": [
{
"type": "non_field_errors",
"msg": "'asyncpg.pgproto.pgproto.UUID' object has no attribute 'replace'"
}
]
}
How can I solve this?
My models where company_id is or as a foreign key on other DB tables are all UUIDs, also the alembic migrations, mapped my database and checked it the company_id is uuid
5
Upvotes
View all comments
Show parent comment
1
u/Ok_Presentation3990 Feb 27 '25
class PayrollSettingsData(BaseModel):id: int = Nonepayroll_policies: PayrollPoliciesData = Noneminimum_salary_policy: MinimumSalaryPolicyData = Nonevacation_policy: VacationPolicyData = Nonecreated_at: str = Noneupdated_at: str = Nonethis class has 3 more classes, like its a huge Codebase