-
-
Notifications
You must be signed in to change notification settings - Fork 528
-
I'm working on upgrading Django Ninja and Pydantic in my project:
Current setup:
- Django Ninja < 1.0 (0.22.2)
- Pydantic v1
Target setup:
- Django Ninja >= 1.0
- Pydantic v2
Challenge:
Django Ninja 0.22.2 strictly depends on Pydantic v1 (pydantic>=1.6,<2.0.0). I tried to maintain compatibility by updating import statements to use pydantic.v1
, but this approach doesn't work with Django Ninja 0.22.2. The codebase is too large to upgrade everything at once.
Has anyone successfully managed incremental migration in this scenario? What strategies did you use?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
Usually process is straightforward if you use standard methods and tools
from django-ninja side you can apply change Config -> Meta (Config.model_fields > Meta.fields) - NOTE: this is not required but recomended as Config will be eventually removed
as for pydantic - you can follow their guide - https://docs.pydantic.dev/latest/migration/#migration-guide
Beta Was this translation helpful? Give feedback.
All reactions
-
👀 1