This commit is contained in:
Mikan
2025-05-18 22:48:39 +03:00
parent c0865fdf51
commit f1dd7fa22a
10 changed files with 236 additions and 23 deletions

View File

@@ -19,7 +19,7 @@ class DepartmentHeadAdmin(admin.ModelAdmin):
list_display = ('department', 'head')
list_filter = ('department',)
autocomplete_fields = ('department', 'head')
search_fields = ('department__name', 'head__first_name', 'head__last_name')
search_fields = ('department__name', 'head__account__first_name', 'head__account__last_name')
@admin.register(Specialty)
@@ -33,7 +33,7 @@ class SpecialtyAdmin(admin.ModelAdmin):
class GroupAdmin(admin.ModelAdmin):
list_display = ('name', 'specialty', 'curator')
list_filter = ('specialty__department', 'specialty')
search_fields = ('name', 'specialty__name', 'curator__first_name', 'curator__last_name')
search_fields = ('name', 'specialty__name', 'curator__account__first_name', 'curator__account__last_name')
autocomplete_fields = ('specialty', 'curator')
@@ -42,7 +42,7 @@ class StudentAdmin(admin.ModelAdmin):
list_display = ('full_name', 'group', 'account')
list_filter = ('group__specialty__department', 'group__specialty', 'group')
search_fields = (
'first_name', 'last_name', 'middle_name',
'account__first_name', 'account__last_name', 'account__middle_name',
'group__name', 'account__login'
)
autocomplete_fields = ('group', 'account')