You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.0 KiB

2 years ago
2 years ago
2 years ago
  1. from django.contrib import admin
  2. from .models import Member
  3. from .models import Project, TextClassificationProject, SequenceLabelingProject, Seq2seqProject, Tag
  4. class MemberAdmin(admin.ModelAdmin):
  5. list_display = (
  6. "user",
  7. "role",
  8. "project",
  9. )
  10. ordering = ("user",)
  11. search_fields = ("user__username",)
  12. class ProjectAdmin(admin.ModelAdmin):
  13. list_display = ("name", "description", "project_type", "random_order", "collaborative_annotation")
  14. ordering = ("project_type",)
  15. search_fields = ("name",)
  16. class TagAdmin(admin.ModelAdmin):
  17. list_display = (
  18. "project",
  19. "text",
  20. )
  21. ordering = (
  22. "project",
  23. "text",
  24. )
  25. search_fields = ("text",)
  26. admin.site.register(Member, MemberAdmin)
  27. admin.site.register(Project, ProjectAdmin)
  28. admin.site.register(TextClassificationProject, ProjectAdmin)
  29. admin.site.register(SequenceLabelingProject, ProjectAdmin)
  30. admin.site.register(Seq2seqProject, ProjectAdmin)
  31. admin.site.register(Tag, TagAdmin)