awtkns / fastapi-crudrouter

A dynamic FastAPI router that automatically creates CRUD routes for your models
https://fastapi-crudrouter.awtkns.com
MIT License
1.34k stars 156 forks source link

Fix bugs that are not compatible with pydantic2.x #191

Open 0x587 opened 10 months ago

0x587 commented 10 months ago

I solved the problem that fastapi-crudrouter is not compatible with pydantic2.x, related issue #189, #190 The changes only involve fastapi_crudrouter/core/_utils.py

vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fastapi-crudrouter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2023 0:10am
cloudyyoung commented 10 months ago

Hey I was wandering around for this issue/pr and I appreciate your work! To add on, another line here would be schema.__fields__[pk_field].annotation for pydantic 2.x.

0x587 commented 10 months ago

Hey I was wandering around for this issue/pr and I appreciate your work! To add on, another line here would be schema.__fields__[pk_field].annotation for pydantic 2.x.

Thank you for your generous advice. Then I got some useful information from https://docs.pydantic.dev/2.3/migration/#changes-to-pydanticbasemodel which suggested me to use model_fields instead of __fields__. I will append these changes to my PR later.

marcelomendoncasoares commented 9 months ago

Hi, everyone! Very interested in this release, as this library will really accelerate the development of a project I have just started. Reading the history, is something still missing to approve? I'd be glad to help.

lohxx commented 8 months ago

Is there any estimate for when this PR will be merged?

0x587 commented 8 months ago

I just added the missing import, and I'm really looking forward to seeing this PR merged. Thank help from @anthonypelletier

0x587 commented 8 months ago

Okay, I have modified the location of the import. @awtkns

jofhanen commented 6 months ago

This is still an issue, will this patch be updated soon?