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.

35 lines
985 B

2 years ago
2 years ago
2 years ago
  1. from django.contrib import admin
  2. from .models import BoundingBox, Category, Segmentation, Span, TextLabel
  3. class SpanAdmin(admin.ModelAdmin):
  4. list_display = ("example", "label", "start_offset", "user")
  5. ordering = ("example",)
  6. class CategoryAdmin(admin.ModelAdmin):
  7. list_display = ("example", "label", "user")
  8. ordering = ("example",)
  9. class TextLabelAdmin(admin.ModelAdmin):
  10. list_display = ("example", "text", "user")
  11. ordering = ("example",)
  12. class BoundingBoxAdmin(admin.ModelAdmin):
  13. list_display = ("example", "label", "user", "x", "y", "width", "height")
  14. ordering = ("example",)
  15. class SegmentationAdmin(admin.ModelAdmin):
  16. list_display = ("example", "label", "user", "points")
  17. ordering = ("example",)
  18. admin.site.register(Category, CategoryAdmin)
  19. admin.site.register(Span, SpanAdmin)
  20. admin.site.register(TextLabel, TextLabelAdmin)
  21. admin.site.register(BoundingBox, BoundingBoxAdmin)
  22. admin.site.register(Segmentation, SegmentationAdmin)