Browse Source

Merge pull request #863 from doccano/fix/issue859

Fix error on Django Admin search, closes #859
pull/864/head
Hiroki Nakayama 4 years ago
committed by GitHub
parent
commit
fd4dc57f92
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions
  1. 12
      app/api/admin.py

12
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)

Loading…
Cancel
Save