Skip to content

Commit 2d95d21

Browse files
authored
Merge pull request #4344 from rtfd/davidfischer/build-admin-improvements
Improvements for the build/version admin
2 parents dfdf4df + 7b916bc commit 2d95d21

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

readthedocs/builds/admin.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,22 @@ class BuildCommandResultInline(admin.TabularInline):
1313

1414
class BuildAdmin(admin.ModelAdmin):
1515
fields = ('project', 'version', 'type', 'state', 'error', 'success', 'length', 'cold_storage')
16-
list_display = ('project', 'success', 'type', 'state', 'date')
16+
list_display = ('id', 'project', 'version_name', 'success', 'type', 'state', 'date')
17+
list_filter = ('type', 'state', 'success')
18+
list_select_related = ('project', 'version')
1719
raw_id_fields = ('project', 'version')
1820
inlines = (BuildCommandResultInline,)
21+
search_fields = ('project__name', 'version__slug')
22+
23+
def version_name(self, obj):
24+
return obj.version.verbose_name
1925

2026

2127
class VersionAdmin(GuardedModelAdmin):
2228
search_fields = ('slug', 'project__name')
23-
list_filter = ('project', 'privacy_level')
29+
list_display = ('slug', 'type', 'project', 'privacy_level', 'active', 'built')
30+
list_filter = ('type', 'privacy_level', 'active', 'built')
31+
raw_id_fields = ('project',)
2432

2533

2634
admin.site.register(Build, BuildAdmin)

0 commit comments

Comments
 (0)