Skip to content

Django2pydantic is the most complete library for converting Django ORM models to Pydantic models

License

Notifications You must be signed in to change notification settings

NextGenContributions/django2pydantic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPI - License PyPI - Downloads

Why

django2pydantic is the most complete Pydantic schemas based on Django models.

What

django2pydantic is a library that allows to define Pydantic schemas based on Django database models.

Similar libraries:

Key features

  • Supports all Django model field types
  • Supports @property decorated Django model methods
  • Supports all Django model relation fields:
    • ForeignKey, OneToOneField, ManyToManyField
    • The reverse relations of the above (ManyToOneRel, OneToOneRel, ManyToManyRel)
  • Supports defining nested relations
  • Provides as complete OpenAPI schema details as possible

How to use

See usage example here.