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.

21 lines
451 B

2 years ago
  1. from django.contrib import admin
  2. from .models import AutoLabelingConfig
  3. class AutoLabelingConfigAdmin(admin.ModelAdmin):
  4. list_display = (
  5. "project",
  6. "model_name",
  7. "model_attrs",
  8. )
  9. ordering = ("project",)
  10. def get_readonly_fields(self, request, obj=None):
  11. if obj:
  12. return ["model_name"]
  13. else:
  14. return []
  15. admin.site.register(AutoLabelingConfig, AutoLabelingConfigAdmin)