Django Admin Column Sort Descending
问题 When using Django admin with grappelli I would like that a click on a column header will sort the table by descending order. (I don't want a default ordering to the columns by defining the ordering field in the Model Meta Class.) The default behavior is Ascending. The first click should order like this: 回答1: Rewrite the def result_headers(cl) add these 2 lines: ..... ..... th_classes = ['sortable'] order_type = '' #new lines default_order_type = getattr(attr, "admin_order_first_type", None)