28 lines
782 B
Python
28 lines
782 B
Python
from django.contrib import admin
|
|
from django.db.models import JSONField
|
|
|
|
from vbv_lernwelt.assignment.models import AssignmentCompletion
|
|
from vbv_lernwelt.core.admin_utils import PrettyJSONWidget
|
|
|
|
|
|
@admin.register(AssignmentCompletion)
|
|
class AssignmentCompletionAdmin(admin.ModelAdmin):
|
|
formfield_overrides = {
|
|
JSONField: {"widget": PrettyJSONWidget(attrs={"rows": 16, "cols": 80})},
|
|
}
|
|
date_hierarchy = "created_at"
|
|
list_display = [
|
|
"id",
|
|
"completion_status",
|
|
"assignment",
|
|
"assignment_user",
|
|
"course_session",
|
|
]
|
|
list_filter = [
|
|
"completion_status",
|
|
"assignment__assignment_type",
|
|
"course_session__course",
|
|
"course_session",
|
|
]
|
|
search_fields = ["assignment_user__email"]
|