1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-11-08 21:21:06 +00:00

Use details instead of list for export

This commit is contained in:
Mo 2022-07-01 18:48:17 +02:00
parent 19b890265a
commit 0e8a3ca0cd

View file

@ -106,6 +106,7 @@ class CustomModelView(ModelView):
# Should not be a copy of column_formatters # Should not be a copy of column_formatters
# because of link formatting. # because of link formatting.
column_formatters_export = {} column_formatters_export = {}
# Used in the UserView because of create_user # Used in the UserView because of create_user
# Should not be touched in other views # Should not be touched in other views
_skip_session_addition_on_model_creation = False _skip_session_addition_on_model_creation = False
@ -207,6 +208,16 @@ class CustomModelView(ModelView):
return formClass(get_form_data(), obj=obj) return formClass(get_form_data(), obj=obj)
def get_export_columns(self):
# Use column_details_list instead of column_list
only_columns = self.column_export_list or self.column_details_list or self.scaffold_list_columns()
return self.get_column_names(
only_columns=only_columns,
excluded_columns=self.column_export_exclude_list,
)
class SecureAdminModelView(CustomModelView): class SecureAdminModelView(CustomModelView):
can_export = True can_export = True