Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change order of columns in Flask-Admin list view

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?

like image 767
ruhee Avatar asked Feb 11 '16 15:02

ruhee


1 Answers

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

Example:

column_list = ['id', 'name', 'other_column']
like image 90
iurisilvio Avatar answered Sep 18 '22 03:09

iurisilvio