mirror of
https://github.com/bugsink/bugsink.git
synced 2026-01-05 21:00:13 -06:00
Use a denormalized field (event_count) in the admin that's been available for a while
This commit is contained in:
@@ -36,7 +36,7 @@ class IssueAdmin(admin.ModelAdmin):
|
||||
list_display = [
|
||||
"title",
|
||||
"project",
|
||||
"event_count", # expensive operation as written now (query in loop)
|
||||
"event_count",
|
||||
]
|
||||
list_filter = [
|
||||
"project",
|
||||
@@ -50,7 +50,3 @@ class IssueAdmin(admin.ModelAdmin):
|
||||
'calculated_value',
|
||||
'event_count',
|
||||
]
|
||||
|
||||
def event_count(self, obj):
|
||||
return str(obj.event_set.count())
|
||||
event_count.short_description = "Event count"
|
||||
|
||||
Reference in New Issue
Block a user