Well I have different collections (i.e. tables), and they have different columns, say collection A has cols a1 and a2, collection B has b1 and b2. I want to show all columns
tried following
class UserView(ModelView):
column_list = None
also
column_exclude_list = None
getting
NotImplementedError
how can I display all fields?
I mean
column_list = ('a1','a2','b1','b2')
works, but I do not want to see empty b1 and b2 fields when looking collection A.
In Flask-Admin one class inheriting ModelView normally represents one SQLAlchemy model. You can show columns of multiple tables in one view if they are connected via relationship or hybrid property. ModelView serves primarily to add basic CRUD operations to your models.
So in your case your should have two classes and two views
See this example: http://examples.flask-admin.org/sqla/simple/admin/
Hope this helps.
In case you don't want to explicitly list all columns you define the constructor as following and all columns in the table (except PK) will be shown
You replace the ModelName with the name of your model class.