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.

54 lines
1.3 KiB

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