From patchwork Sun Oct 14 12:45:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 983719 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42Y1bc16hbz9s8F for ; Sun, 14 Oct 2018 23:49:00 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="nSaGAa0U"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42Y1bb6HnlzF3B0 for ; Sun, 14 Oct 2018 23:48:59 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="nSaGAa0U"; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=that.guru (client-ip=185.234.75.8; helo=relay001.mxroute.com; envelope-from=stephen@that.guru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="nSaGAa0U"; dkim-atps=neutral Received: from relay001.mxroute.com (relay001.mxroute.com [185.234.75.8]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42Y1YQ5jLjzF0ym for ; Sun, 14 Oct 2018 23:47:06 +1100 (AEDT) Received: from filter002.mxroute.com (unknown [185.133.192.179]) by relay001.mxroute.com (Postfix) with ESMTP id 4F4393F4FD; Sun, 14 Oct 2018 12:46:34 +0000 (UTC) Received: from one.mxroute.com (one.mxroute.com [195.201.59.211]) by filter002.mxroute.com (Postfix) with ESMTPS id 376B33F53E; Sun, 14 Oct 2018 12:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=DX3Why4GA9FBxWF7VNvi96MhKyTHZLcRPKN1Giuvaro=; b=nSaGAa0Ul0v+v7Uv6cmpoMnrZK IGmH2s5lkd13tdAwFnJxmf3rXkci3PwXE5LgGjNZ/2764v2fXdwKFyijsVek+bdvPdfg+4SQwPvuD bv93a+AVzIfx+DPhic70fonksq/g+KItKiAB0Px9g03MN0bVIb4d6xWJN1v/RWEEHk2uc8jzDTYLC ECI+mUETTH4ps+BIUHlTIYsFwo9B3XBH6dceTlwrnXHp32U2xdaMP2hCrSj6McvoUid0G0Q97po6k N4jUbe54sBGac8BCymYY3YZ0cPCXKJ7eMnI+WNYM8WBPhWPNrUcV9AsVF880dmhNzbHmSAiKPQ56z YOTIqIbg==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH v2 05/10] admin: Group register calls at bottom Date: Sun, 14 Oct 2018 13:45:36 +0100 Message-Id: <20181014124541.13393-6-stephen@that.guru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181014124541.13393-1-stephen@that.guru> References: <20181014124541.13393-1-stephen@that.guru> X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mpe@ellerman.id.au, andrew.donnellan@au1.ibm.com MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" This seems more intuitive. Signed-off-by: Stephen Finucane --- patchwork/admin.py | 48 +++++++++++++--------------------------------- 1 file changed, 13 insertions(+), 35 deletions(-) diff --git a/patchwork/admin.py b/patchwork/admin.py index f12b3387..0e9ccfa7 100644 --- a/patchwork/admin.py +++ b/patchwork/admin.py @@ -33,10 +33,6 @@ class UserAdmin(BaseUserAdmin): inlines = (UserProfileInline, ) -admin.site.unregister(User) -admin.site.register(User, UserAdmin) - - class DelegationRuleInline(admin.TabularInline): model = DelegationRule fields = ('path', 'user', 'priority') @@ -49,9 +45,6 @@ class ProjectAdmin(admin.ModelAdmin): ] -admin.site.register(Project, ProjectAdmin) - - class PersonAdmin(admin.ModelAdmin): list_display = ('__str__', 'has_account') search_fields = ('name', 'email') @@ -64,16 +57,10 @@ class PersonAdmin(admin.ModelAdmin): has_account.short_description = 'Account' -admin.site.register(Person, PersonAdmin) - - class StateAdmin(admin.ModelAdmin): list_display = ('name', 'action_required') -admin.site.register(State, StateAdmin) - - class SubmissionAdmin(admin.ModelAdmin): list_display = ('name', 'submitter', 'project', 'date') list_filter = ('project', ) @@ -81,10 +68,6 @@ class SubmissionAdmin(admin.ModelAdmin): date_hierarchy = 'date' -admin.site.register(Submission, SubmissionAdmin) -admin.site.register(CoverLetter, SubmissionAdmin) - - class PatchAdmin(admin.ModelAdmin): list_display = ('name', 'submitter', 'project', 'state', 'date', 'archived', 'is_pull_request') @@ -101,18 +84,12 @@ class PatchAdmin(admin.ModelAdmin): is_pull_request.short_description = 'Pull' -admin.site.register(Patch, PatchAdmin) - - class CommentAdmin(admin.ModelAdmin): list_display = ('submission', 'submitter', 'date') search_fields = ('submission__name', 'submitter__name', 'submitter__email') date_hierarchy = 'date' -admin.site.register(Comment, CommentAdmin) - - class PatchInline(admin.StackedInline): model = Series.patches.through extra = 0 @@ -135,16 +112,10 @@ class SeriesAdmin(admin.ModelAdmin): return qs.prefetch_related('patches',) -admin.site.register(Series, SeriesAdmin) - - class SeriesReferenceAdmin(admin.ModelAdmin): model = SeriesReference -admin.site.register(SeriesReference, SeriesReferenceAdmin) - - class CheckAdmin(admin.ModelAdmin): list_display = ('patch', 'user', 'state', 'target_url', 'description', 'context') @@ -153,20 +124,27 @@ class CheckAdmin(admin.ModelAdmin): date_hierarchy = 'date' -admin.site.register(Check, CheckAdmin) - - class BundleAdmin(admin.ModelAdmin): list_display = ('name', 'owner', 'project', 'public') list_filter = ('public', 'project') search_fields = ('name', 'owner') -admin.site.register(Bundle, BundleAdmin) - - class TagAdmin(admin.ModelAdmin): list_display = ('name',) +admin.site.unregister(User) +admin.site.register(User, UserAdmin) +admin.site.register(Project, ProjectAdmin) +admin.site.register(Person, PersonAdmin) +admin.site.register(State, StateAdmin) +admin.site.register(Submission, SubmissionAdmin) +admin.site.register(CoverLetter, SubmissionAdmin) +admin.site.register(Patch, PatchAdmin) +admin.site.register(Comment, CommentAdmin) +admin.site.register(Series, SeriesAdmin) +admin.site.register(SeriesReference, SeriesReferenceAdmin) +admin.site.register(Check, CheckAdmin) +admin.site.register(Bundle, BundleAdmin) admin.site.register(Tag, TagAdmin)