diff --git a/app/api/admin.py b/app/api/admin.py index 5a3cf4ce..58ca2cc6 100644 --- a/app/api/admin.py +++ b/app/api/admin.py @@ -9,13 +9,13 @@ from .models import TextClassificationProject, SequenceLabelingProject, Seq2seqP class LabelAdmin(admin.ModelAdmin): list_display = ('text', 'project', 'text_color', 'background_color') ordering = ('project',) - search_fields = ('project',) + search_fields = ('text',) class DocumentAdmin(admin.ModelAdmin): list_display = ('text', 'project', 'meta') ordering = ('project',) - search_fields = ('project',) + search_fields = ('text',) class ProjectAdmin(admin.ModelAdmin): @@ -27,19 +27,19 @@ class ProjectAdmin(admin.ModelAdmin): class SequenceAnnotationAdmin(admin.ModelAdmin): list_display = ('document', 'label', 'start_offset', 'user') ordering = ('document',) - search_fields = ('document',) + search_fields = ('document__text',) class DocumentAnnotationAdmin(admin.ModelAdmin): list_display = ('document', 'label', 'user') ordering = ('document',) - search_fields = ('document',) + search_fields = ('document__text',) class Seq2seqAnnotationAdmin(admin.ModelAdmin): list_display = ('document', 'text', 'user') ordering = ('document',) - search_fields = ('document',) + search_fields = ('document__text',) class RoleAdmin(admin.ModelAdmin): @@ -51,7 +51,7 @@ class RoleAdmin(admin.ModelAdmin): class RoleMappingAdmin(admin.ModelAdmin): list_display = ('user', 'role', 'project', ) ordering = ('user',) - search_fields = ('user',) + search_fields = ('user__username',) admin.site.register(DocumentAnnotation, DocumentAnnotationAdmin)