From patchwork Wed Apr 11 16:13:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 897275 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 40Lpyx25kWz9s27 for ; Thu, 12 Apr 2018 02:14:49 +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="Sdf1f/zq"; 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 40Lpyx0dQKzF1Rw for ; Thu, 12 Apr 2018 02:14:49 +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="Sdf1f/zq"; 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.209.66; helo=gecko.birch.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="Sdf1f/zq"; dkim-atps=neutral Received: from gecko.birch.relay.mailchannels.net (gecko.birch.relay.mailchannels.net [23.83.209.66]) (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 40Lpxv5bsCzF0dY for ; Thu, 12 Apr 2018 02:13:55 +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 B0C5F3E2695 for ; Wed, 11 Apr 2018 16:13:48 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.15.83]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id CCD583E3327 for ; Wed, 11 Apr 2018 16:13:47 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.18.55.125]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.14.1); Wed, 11 Apr 2018 16:13:48 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Harbor-Bored: 3e284549157a2478_1523463228207_1813906685 X-MC-Loop-Signature: 1523463228207:3170891671 X-MC-Ingress-Time: 1523463228207 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=sLAekzTXVHVGJIJ7qqMPyZz8bMsdKAsibVaHJF6T3RE=; b=Sdf1f/zqYOGCqC9Cr+P862ZiBA xoyjZPZiz70L5BVGibCybuWe0e+d+dnQM8Qwo6NfjfIXWOGqDa4/W66K/WC5J+GQQjsXpFjTfkvtk zedD7Zn20YsUKONyA434akHBKwEA8sDAMwv2OrQcSpii6i2A+drUisrLVlwYQHTgdfP/G4i9iAeLd QOdZ4C2EuCLT0QnaTQFLEhtHE1PR8Jg5yAAxpUwbo+Njdnivm3rmUkiU1SuZ8JXDIUUfMDeJDsUqW ZIm5dgPoDvMdAGYq0RZnTZATLA+NndCmj3s+6Ec27FHXpo2aBuIr7taE6ZHAXnyPhgoLA8AUhdZbv 6fa1h7PA==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 4/7] REST: Remove ProjectFilterMixin Date: Wed, 11 Apr 2018 17:13:35 +0100 Message-Id: <20180411161338.420-5-stephen@that.guru> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180411161338.420-1-stephen@that.guru> References: <20180411161338.420-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" Whatever benefits this was giving us in the past are no more and it simply confuses matters now. Signed-off-by: Stephen Finucane Reviewed-by: Daniel Axtens --- patchwork/api/filters.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/patchwork/api/filters.py b/patchwork/api/filters.py index b30499d0..7d94d5ed 100644 --- a/patchwork/api/filters.py +++ b/patchwork/api/filters.py @@ -141,22 +141,19 @@ class TimestampMixin(FilterSet): since = IsoDateTimeFilter(name='date', lookup_expr='gte') -class ProjectMixin(FilterSet): - - project = ProjectFilter(queryset=Project.objects.all()) - - -class SeriesFilter(ProjectMixin, TimestampMixin, FilterSet): +class SeriesFilter(TimestampMixin, FilterSet): submitter = PersonFilter(queryset=Person.objects.all()) + project = ProjectFilter(queryset=Project.objects.all()) class Meta: model = Series fields = ('submitter', 'project') -class CoverLetterFilter(ProjectMixin, TimestampMixin, FilterSet): +class CoverLetterFilter(TimestampMixin, FilterSet): + project = ProjectFilter(queryset=Project.objects.all()) submitter = PersonFilter(queryset=Person.objects.all()) class Meta: @@ -164,8 +161,9 @@ class CoverLetterFilter(ProjectMixin, TimestampMixin, FilterSet): fields = ('project', 'series', 'submitter') -class PatchFilter(ProjectMixin, TimestampMixin, FilterSet): +class PatchFilter(TimestampMixin, FilterSet): + project = ProjectFilter(queryset=Project.objects.all()) submitter = PersonFilter(queryset=Person.objects.all()) delegate = UserFilter(queryset=User.objects.all()) state = StateFilter(queryset=State.objects.all()) @@ -185,15 +183,18 @@ class CheckFilter(TimestampMixin, FilterSet): fields = ('user', 'state', 'context') -class EventFilter(ProjectMixin, TimestampMixin, FilterSet): +class EventFilter(TimestampMixin, FilterSet): + + project = ProjectFilter(queryset=Project.objects.all()) class Meta: model = Event fields = ('project', 'category', 'series', 'patch', 'cover') -class BundleFilter(ProjectMixin, FilterSet): +class BundleFilter(FilterSet): + project = ProjectFilter(queryset=Project.objects.all()) owner = UserFilter(queryset=User.objects.all()) class Meta: