Is your feature request related to a problem? Please describe.
Yes, I want to be able to specify different base classes for my generated models.
Describe the solution you'd like
We can specify the base class for all models using --base-class
. For example, if my package is like this
my_package/base_classes.py
pyproject.toml
Then I can specify them as --base-class=my_package.base_classes.MyBaseClass
, but this applies to all models, which is clearly undesirable. Ideally, we should be able to specify the base class for each model that is generated.
For example, we could have the flag --base-classes=base_classes.json
, then base_classes.json
would look like
{
"MyModel": "MyBaseClass",
"MyModel2": "MyBaseClass2",
}
Or something like that
Describe alternatives you've considered
The alternative could be to override the template and specify the base model depending on the name of the class, but the problem is that we can't import the base class in that way. The template only applies to a single model not the full module or Python file.
We could define the base class in the template, but this is really not ideal, because we want to reuse.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too