From patchwork Sun Apr 15 22:54:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 898336 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 ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40PRhZ0fgLz9s1R for ; Mon, 16 Apr 2018 08:56:30 +1000 (AEST) 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="N+rdXz9U"; 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 40PRhY68FQzF1s5 for ; Mon, 16 Apr 2018 08:56:29 +1000 (AEST) 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="N+rdXz9U"; 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=23.83.214.27; helo=butterfly.maple.relay.mailchannels.net; 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="N+rdXz9U"; dkim-atps=neutral Received: from butterfly.maple.relay.mailchannels.net (butterfly.maple.relay.mailchannels.net [23.83.214.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40PRf601SWzF1Rv for ; Mon, 16 Apr 2018 08:54:21 +1000 (AEST) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id E1DBF40868 for ; Sun, 15 Apr 2018 22:54:18 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.12.37]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id 80F504041A for ; Sun, 15 Apr 2018 22:54:18 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.19.42.253]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.14.1); Sun, 15 Apr 2018 22:54:18 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Shade-Scare: 406cdbad619f8ca5_1523832858783_3364822070 X-MC-Loop-Signature: 1523832858783:2181319806 X-MC-Ingress-Time: 1523832858783 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=5M3g+6RjBIkgRU44ndWjxFTLk+uKkJVpZ0iQ3/Ou0ds=; b=N+rdXz9U9bPvf8ynEidvAGXgQt c051Codwq2NcMQrC/dN1UpDZ1A+U9fBAEtzbSQW9bYg9UvArrnlLY1HJacwOvwk7bJ1eFp1Ubwbod yQ8L/HCR2bow91ojfJ7hVR57GeaoG9P1+LB2r81cEGF9jGxhkv2SW/NOPGa7Z2c0XDamBg4vij8vI ynCscYOUa4XXIf++NcsoJt4TsYN7a+ghEvpdNrJaGra4wQ9ir4jCSQHE39ix9/MxVWrI53tnhPNlv KlvwoYZ0+hkk8VBl4VfKyfPljHLxYN9Kfd+oxiD+mM4lhyLl0Up8FpsQr7C3UJvn/vU9nWEUiDF/N T9TILw1A==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 06/11] admin: Add label views Date: Sun, 15 Apr 2018 23:54:00 +0100 Message-Id: <20180415225405.1354-7-stephen@that.guru> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180415225405.1354-1-stephen@that.guru> References: <20180415225405.1354-1-stephen@that.guru> X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" There are two added: a general labels view that includes both project and non-project labels, and an inline labels view that's part of the project. Signed-off-by: Stephen Finucane --- patchwork/admin.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/patchwork/admin.py b/patchwork/admin.py index 0c006fd9..b1278610 100644 --- a/patchwork/admin.py +++ b/patchwork/admin.py @@ -28,6 +28,7 @@ from patchwork.models import Check from patchwork.models import Comment from patchwork.models import CoverLetter from patchwork.models import DelegationRule +from patchwork.models import Label from patchwork.models import Patch from patchwork.models import Person from patchwork.models import Project @@ -54,10 +55,16 @@ class DelegationRuleInline(admin.TabularInline): fields = ('path', 'user', 'priority') +class LabelInline(admin.TabularInline): + model = Label + fields = ('name', 'description', 'color') + + class ProjectAdmin(admin.ModelAdmin): list_display = ('name', 'linkname', 'listid', 'listemail') inlines = [ DelegationRuleInline, + LabelInline, ] @@ -87,6 +94,7 @@ class SubmissionAdmin(admin.ModelAdmin): class PatchAdmin(admin.ModelAdmin): list_display = ('name', 'submitter', 'project', 'state', 'date', 'archived', 'is_pull_request') + readonly_fields = ('labels',) list_filter = ('project', 'state', 'archived') search_fields = ('name', 'submitter__name', 'submitter__email') date_hierarchy = 'date' @@ -158,6 +166,10 @@ class TagAdmin(admin.ModelAdmin): list_display = ('name',) +class LabelAdmin(admin.ModelAdmin): + list_display = ('name', 'color') + + admin.site.unregister(User) admin.site.register(User, UserAdmin) admin.site.register(Project, ProjectAdmin) @@ -172,3 +184,4 @@ admin.site.register(SeriesReference, SeriesReferenceAdmin) admin.site.register(Check, CheckAdmin) admin.site.register(Bundle, BundleAdmin) admin.site.register(Tag, TagAdmin) +admin.site.register(Label, LabelAdmin)