azzmxq
azzmxq

Reputation: 1

Dynamically sort in Django admin

In Django admin, Is it possible that dynamically sort by field name using url param?

In this way, https://www.example.com/admin/blog/article/?order=modified_date https://www.example.com/admin/blog/article/?order=deleted_date

Upvotes: 0

Views: 283

Answers (1)

Brent Washburne
Brent Washburne

Reputation: 13138

Depending on your version of Django, you can use the get_ordering() method in your ModelAdmin class.

Upvotes: 1

Related Questions