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.

17 lines
421 B

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