Change order of columns in Flask-Admin list view
Asked Answered
M

1

6

I have a Flask-Admin list view (ModelView) of my user model with some fields excluded, custom headers, etc. Everything's working correctly and I've overridden the default list template so I can match the styling of the rest of the application.

However, my foreign key columns appear at the beginning of the list, and I need to move them around so the table makes a bit more sense.

How do I specify what order the columns appear in? Is this possible, or do I just need to add some nasty conditionals in my list template?

Mam answered 11/2, 2016 at 15:20 Comment(1)
column_list = ['first_name', 'last_name', 'email', 'organisation', 'active', 'credit_balance', 'debit_balance'].Anyway
I
9

Define the column_list. You define which columns appear and their order.

Example:

column_list = ['id', 'name', 'other_column']
Imperfective answered 25/2, 2016 at 12:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.