27 lines
1 KiB
Python
27 lines
1 KiB
Python
from django.contrib import admin
|
|
|
|
from .models import Project, Revision
|
|
|
|
|
|
@admin.register(Project)
|
|
class ProjectAdmin(admin.ModelAdmin):
|
|
list_display = ("name", "owner", "fps", "thumbnail_status", "updated")
|
|
list_filter = ("owner", "thumbnail_status")
|
|
search_fields = ("name",)
|
|
filter_horizontal = ("collaborators",)
|
|
readonly_fields = ("thumbnail_status", "thumbnail_manifest", "thumbnail_error",
|
|
"created", "updated")
|
|
fields = ("name", "owner", "collaborators", "otio", "clip", "fps", "scene",
|
|
"thumbnail_status", "thumbnail_manifest", "thumbnail_error",
|
|
"created", "updated")
|
|
|
|
|
|
@admin.register(Revision)
|
|
class RevisionAdmin(admin.ModelAdmin):
|
|
list_display = ("project", "user", "created", "summary")
|
|
list_filter = ("project", "user")
|
|
date_hierarchy = "created"
|
|
readonly_fields = ("project", "user", "created", "summary", "annotations")
|
|
|
|
def has_add_permission(self, request):
|
|
return False # revisions are written by the API, not by hand
|