Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements for the build/version admin #4344

Merged
merged 1 commit into from
Jul 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions readthedocs/builds/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,22 @@ class BuildCommandResultInline(admin.TabularInline):

class BuildAdmin(admin.ModelAdmin):
fields = ('project', 'version', 'type', 'state', 'error', 'success', 'length', 'cold_storage')
list_display = ('project', 'success', 'type', 'state', 'date')
list_display = ('id', 'project', 'version_name', 'success', 'type', 'state', 'date')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think the id could be removed from this list since I suppose it's not very useful.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! If we remove the id the link would be the project and it will be confusing. So, I suppose that was what you wanted. In that case, I'm 👍 on leaving it.

I'm sorry.

list_filter = ('type', 'state', 'success')
list_select_related = ('project', 'version')
raw_id_fields = ('project', 'version')
inlines = (BuildCommandResultInline,)
search_fields = ('project__name', 'version__slug')

def version_name(self, obj):
return obj.version.verbose_name


class VersionAdmin(GuardedModelAdmin):
search_fields = ('slug', 'project__name')
list_filter = ('project', 'privacy_level')
list_display = ('slug', 'type', 'project', 'privacy_level', 'active', 'built')
list_filter = ('type', 'privacy_level', 'active', 'built')
raw_id_fields = ('project',)


admin.site.register(Build, BuildAdmin)
Expand Down