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.

46 lines
1.0 KiB

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