admin.py 450 B

1234567891011121314151617
  1. from django.contrib import admin
  2. from .models import FileBlob, File
  3. class FileBlobAdmin(admin.ModelAdmin):
  4. search_fields = ("checksum",)
  5. list_display = ("checksum", "size", "created")
  6. class FileAdmin(admin.ModelAdmin):
  7. search_fields = ("name", "checksum")
  8. list_display = ("name", "type", "checksum", "blob")
  9. list_filter = ("type", "created")
  10. admin.site.register(FileBlob, FileBlobAdmin)
  11. admin.site.register(File, FileAdmin)