-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way to customize the model Config class #285
Comments
Yeah I had it on mind for quite some time. You still can edit the config after class declaration as it's stored in class Model(ormar.Model):
...
Model.__config__.allow_mutation = False But allowing to overwrite the config in class declaration should be the preferred way. |
Oh great, that will work for me for now, thanks. I was just typing up a patch, so I'll keep that below, I'm sure you're aware of this possible solution. In
with:
|
Yep, if you can issue a PR with this solution that would be welcomed too! :) |
Released in 0.10.16 - thanks again! :) |
Is your feature request related to a problem? Please describe.
I would like to customize the model config, specifically to specify
allow_mutation = False
.Describe the solution you'd like
If a
Config
class is defined in the model, use it instead ofget_pydantic_base_orm_config
/Describe alternatives you've considered
The only solution I've found so far is to subclass ormar's ModelMetaclass and override the new method.
The text was updated successfully, but these errors were encountered: