It seems that pydantic does not allow passing both base and config arguments to create_model function, to avoid confusion.
What I tried to do is:
from pydantic import BaseModel, create_model
class Config:
orm_mode = True
E = create_model('E', name='name', __base__=BaseModel)
B = create_model('B', age=1, __base__=E, __config__=Config)
Using classes this is very simple:
class E(BaseModel):
name = 'name'
class B(E):
age = 18
class Config:
orm_mode = True
Is there any way to do this using create_model?