From c0352e62cf75e2958ddfc89e775e750adb980dfd Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Tue, 16 Feb 2010 13:18:26 +0100 Subject: [PATCH] update admin stuff to use the `booted' property --- pyweb/mumble/admin.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pyweb/mumble/admin.py b/pyweb/mumble/admin.py index ea1b57f..8b4a4c2 100644 --- a/pyweb/mumble/admin.py +++ b/pyweb/mumble/admin.py @@ -23,14 +23,20 @@ from mumble.models import Mumble, MumbleUser class MumbleAdmin(admin.ModelAdmin): """ Specification for the "Server administration" admin section. """ - list_display = [ 'name', 'addr', 'port', 'booted', 'get_is_public', + list_display = [ 'name', 'addr', 'port', 'get_booted', 'get_is_public', 'get_users_regged', 'get_users_online', 'get_channel_count' ]; - list_filter = [ 'booted', 'addr' ]; - search_fields = [ 'name', 'addr' ]; + list_filter = [ 'addr' ]; + search_fields = [ 'name', 'addr', 'port' ]; ordering = [ 'name' ]; form = MumbleAdminForm; + def get_booted( self, obj ): + return obj.booted + + get_booted.short_description = _('Boot Server') + get_booted.boolean = True + def get_users_regged( self, obj ): """ Populates the "Registered users" column. """ if obj.booted: