Sort by name/date in events overview admin
One-sentence description
Sort by date in events overview admin
Desired behaviour
The events in the admin overview (/admin/events) are sorted by id by default. Since we have overridden the event name, date and registration start columns for them to be a link and contain the week day respectively these are not sortable automatically anymore.
This could be solved by adding the admin_order_field
attribute:
def colored_first_name(self):
return format_html(
'<span style="color: #{};">{}</span>',
self.color_code,
self.first_name,
)
colored_first_name.admin_order_field = 'first_name'
- Overview link:
title
(if possible due to translation) - Date:
start
- Registration start:
registration_start
Edited by Ghost User