Adding new model backendΒΆ
If you want to implement new database backend to use with model views, follow steps found in this guideline.
There are few assumptions about models:
- Model has “primary key” - value which uniquely identifies one model in a data store. There’s no restriction on the data type or field name.
- Model has readable python properties
- It is possible to get list of models (optionally - sorted, filtered, etc) from data store
- It is possible to get one model by its primary key
Steps to add new model backend:
Create new class and derive it from
BaseModelAdmin
:class MyDbModel(BaseModelView): passBy default, all model views accept model class and it will be stored as
self.model
.
- PLEASE VIEW
ModelAdmin
for how to do a new backend.
Feel free ask questions if you have problem adding new model backend.