Skip to content

Commit

Permalink
Better search on admin
Browse files Browse the repository at this point in the history
  • Loading branch information
luisza committed Apr 30, 2024
1 parent 92f46f3 commit 4f64f61
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/academic/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

from academic import models

admin.site.register(models.Procedure)
class ProcedureAdmin(admin.ModelAdmin):
search_fields = ['title']

admin.site.register(models.Procedure, ProcedureAdmin)
8 changes: 6 additions & 2 deletions src/auth_and_perms/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ def auth_token(self, obj):
return obj.user.auth_token.key
return 'unknown'

class ProfileAdmin(admin.ModelAdmin):
search_fields = ['user__username', 'user__email']

class ProfilePermissionAdmin(admin.ModelAdmin):
search_fields = ['profile__user__email']
admin.site.register(models.AuthorizedApplication, AuthorizedApplicationAdmin)
admin.site.register(models.Profile)
admin.site.register(models.Profile, ProfileAdmin)
admin.site.register(models.Rol, RolAdmin)
admin.site.register(models.ProfilePermission)
admin.site.register(models.ProfilePermission, ProfilePermissionAdmin)
3 changes: 3 additions & 0 deletions src/laboratory/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def export_laboratory(admin, request, queryset):

class LaboratoryAdmin(admin.ModelAdmin):
actions = [export_laboratory]
search_fields = ['name']
list_filter = ['organization']


admin.site.register(models.Laboratory, LaboratoryAdmin)
admin.site.register(models.Protocol)
Expand Down

0 comments on commit 4f64f61

Please sign in to comment.