mirror of
https://github.com/bugsink/bugsink.git
synced 2026-01-05 21:00:13 -06:00
21 lines
442 B
Python
21 lines
442 B
Python
from django.contrib import admin
|
|
|
|
from .models import Issue
|
|
|
|
|
|
@admin.register(Issue)
|
|
class IssueAdmin(admin.ModelAdmin):
|
|
list_display = [
|
|
"hash",
|
|
"event_count", # expensive operation as written now (query in loop)
|
|
]
|
|
exclude = ["events"]
|
|
|
|
readonly_fields = [
|
|
'event_count',
|
|
]
|
|
|
|
def event_count(self, obj):
|
|
return str(obj.events.count())
|
|
event_count.short_description = "Event count"
|