Commit cca80f7f authored by Tom Kunze's avatar Tom Kunze
Browse files

server/admin: Fix related errors in django-admin search

parent 568e7d4e
...@@ -4,15 +4,16 @@ from .models import Host, Room, Exercise, ExerciseUser, Request, ExerciseOption ...@@ -4,15 +4,16 @@ from .models import Host, Room, Exercise, ExerciseUser, Request, ExerciseOption
class HostAdmin(admin.ModelAdmin): class HostAdmin(admin.ModelAdmin):
list_display = ('host_name', 'occupied', 'user_name', 'user_gecos', 'user_idle', list_display = ('host_name', 'room', 'occupied', 'user_name', 'user_gecos',
'last_update') 'user_idle', 'last_update')
search_fields = list_display search_fields = ('host_name', 'user_name', 'user_gecos')
class RoomAdmin(admin.ModelAdmin): class RoomAdmin(admin.ModelAdmin):
list_display = ('name', 'name_long', 'name_number', 'numbers', 'temp_hosts', list_display = ('name', 'name_long', 'name_number', 'numbers', 'temp_hosts',
'order') 'order')
search_fields = list_display search_fields = ('name', 'name_long', 'name_number', 'numbers',
'temp_hosts')
class ExerciseAdmin(admin.ModelAdmin): class ExerciseAdmin(admin.ModelAdmin):
...@@ -23,12 +24,12 @@ class ExerciseAdmin(admin.ModelAdmin): ...@@ -23,12 +24,12 @@ class ExerciseAdmin(admin.ModelAdmin):
class ExerciseUserAdmin(admin.ModelAdmin): class ExerciseUserAdmin(admin.ModelAdmin):
list_display = ('name', 'realname', 'exercise', 'status', 'unique') list_display = ('name', 'realname', 'exercise', 'status', 'unique')
search_fields = ('name', 'realname') search_fields = ('name', 'realname', 'exercise__name')
class RequestAdmin(admin.ModelAdmin): class RequestAdmin(admin.ModelAdmin):
list_display = ('host', 'exercise', 'time', 'priority', 'request_type') list_display = ('host', 'exercise', 'time', 'priority', 'request_type')
search_fields = ('host', ) search_fields = ('host', 'exercise__name')
class ExerciseOptionAdmin(admin.ModelAdmin): class ExerciseOptionAdmin(admin.ModelAdmin):
...@@ -36,7 +37,7 @@ class ExerciseOptionAdmin(admin.ModelAdmin): ...@@ -36,7 +37,7 @@ class ExerciseOptionAdmin(admin.ModelAdmin):
'use_submission_list', 'keep_requests', 'use_submission_list', 'keep_requests',
'show_requests_longer', 'use_special_list', 'show_requests_longer', 'use_special_list',
'special_list_name', 'special_list_button', 'statistics') 'special_list_name', 'special_list_button', 'statistics')
search_fields = list_display search_fields = ('exercise_name', 'special_list_name')
admin.site.register(Host, HostAdmin) admin.site.register(Host, HostAdmin)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment