Sort Event admin by start_time, descending
This commit is contained in:
parent
e0df6b3f5b
commit
ef77c8faed
1 changed files with 2 additions and 2 deletions
|
@ -52,8 +52,8 @@ admin.site.register(Place, PlaceAdmin)
|
|||
|
||||
class EventAdmin(admin.ModelAdmin):
|
||||
raw_id_fields = ('place', 'created_by')
|
||||
list_display = ('__str__', 'attendee_count', 'created_by', 'created_time')
|
||||
ordering = ('-created_time',)
|
||||
list_display = ('__str__', 'attendee_count', 'start_time', 'created_by', 'created_time')
|
||||
ordering = ('-start_time',)
|
||||
def attendee_count(self, event):
|
||||
return event.attendees.all().count()
|
||||
attendee_count.short_description = 'Attendees'
|
||||
|
|
Loading…
Reference in a new issue