I recently had a situation where I wanted to add some additional fields to get_<ORM-NAME>_fields and have those set on the created orm instance, there is currently no way to do this, so I'm proposing:
I'd have to make sure the lifecycle of the **kwargs continues so that the extra_field can make it all the way to instance_orm.
Another approach without the created_orm method, would be to have some value you can set in get_orm_fields and those will be automatically added to the instance. This might be the better approach, there can still be a method that can be overridden but it would be nice to handle everything in the get_<NAME>_fields method.
I could also name the method: get_orm_instance which would fit better with get_orm_fields
I recently had a situation where I wanted to add some additional fields to
get_<ORM-NAME>_fields
and have those set on the created orm instance, there is currently no way to do this, so I'm proposing:I'd have to make sure the lifecycle of the
**kwargs
continues so that theextra_field
can make it all the way toinstance_orm
.Another approach without the
created_orm
method, would be to have some value you can set inget_orm_fields
and those will be automatically added to the instance. This might be the better approach, there can still be a method that can be overridden but it would be nice to handle everything in theget_<NAME>_fields
method.I could also name the method:
get_orm_instance
which would fit better withget_orm_fields