mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
21 lines
513 B
Python
21 lines
513 B
Python
from django.utils.html import escape, mark_safe
|
|
from django.contrib import admin
|
|
|
|
import json
|
|
|
|
from .models import DecompressedEvent
|
|
|
|
|
|
@admin.register(DecompressedEvent)
|
|
class DecompressedEventAdmin(admin.ModelAdmin):
|
|
list_display = ["timestamp", "project"]
|
|
exclude = ["data"]
|
|
|
|
readonly_fields = [
|
|
'pretty_data',
|
|
]
|
|
|
|
def pretty_data(self, obj):
|
|
return mark_safe("<pre>" + escape(json.dumps(json.loads(obj.data), indent=2)) + "</pre>")
|
|
pretty_data.short_description = "Data"
|