Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 3B5BEE0111C; Thu, 8 Oct 2015 11:32:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.212.174 listed in list.dnswl.org] Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id DA547E010BB for ; Thu, 8 Oct 2015 11:32:43 -0700 (PDT) Received: by wicge5 with SMTP id ge5so38013199wic.0 for ; Thu, 08 Oct 2015 11:32:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pQ6LhD9XSh9oXx3mLRJSQPM0kDKBzhcGwJVc+N3bhcg=; b=dBF2/6Gvl1apXaGc1HS0koc5oMk0KDscCUGM9xPtLsVwXsmU7nzFT19NhNeE5cwPWC DpJVVeTU7XKsRiW/imvGgVtyMjXTUBk41OinxNd4boRVnEGQvblAssFcf2huxg9AYl7W MgaIudsyLHa2i+WJOkFXLlY50t60yXKvnfCUn0AT1AVLaNFa+W/2QNdER93l3w8SdqJR 9hBpJjcWZaWrSlwceX92t3cOrVoq2Fu4EAGfEuzv/O108sWyriwoLoLldH337Pnp8SMz A4p2bhHFiGzT1r1IdkGpdWFLxZHXjcz6iJoqE3teYdLxhrF/fazhgTfloU7N5Pj3fjnb Y8Qw== X-Gm-Message-State: ALoCoQnpD3IyjBSnI45Wvh7GERMzifI2xR8i1mEe7IDRFJsIN826KH6l87f5O6P+9XiSHtztMxqc X-Received: by 10.194.77.240 with SMTP id v16mr9309766wjw.109.1444329163155; Thu, 08 Oct 2015 11:32:43 -0700 (PDT) Received: from dorado.Home ([2.218.205.118]) by smtp.gmail.com with ESMTPSA id x9sm47729394wjf.44.2015.10.08.11.32.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Oct 2015 11:32:42 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 8 Oct 2015 19:32:35 +0100 Message-Id: <1444329157-11590-4-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1444329157-11590-1-git-send-email-michael.g.wood@intel.com> References: <1444329157-11590-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 3/5] toaster: tables Add the recipe filter back into the Recipe table X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2015 18:32:47 -0000 Add the "Is recipe currently available in the project" filter back to the Recipe table which was removed when we had intermediate AvailableRecipe tables. Signed-off-by: Michael Wood --- bitbake/lib/toaster/toastergui/tables.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index a676ffa..4f24772 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py @@ -335,10 +335,23 @@ class RecipesTable(ToasterTable, ProjectFiltersMixin): return context + def setup_filters(self, *args, **kwargs): + self.add_filter(title="Filter by project recipes", + name="in_current_project", + filter_actions=[ + self.make_filter_action("in_project", "Recipes provided by layers added to this project", self.filter_in_project), + self.make_filter_action("not_in_project", "Recipes provided by layers not added to this project", self.filter_not_in_project) + ]) def setup_queryset(self, *args, **kwargs): prj = Project.objects.get(pk = kwargs['pid']) + # Project layers used by the filters + self.project_layers = prj.get_project_layer_versions(pk=True) + + # Project layers used to switch the button states + self.static_context_extra['current_layers'] = self.project_layers + self.queryset = prj.get_all_compatible_recipes() self.queryset = self.queryset.order_by(self.default_orderby) -- 2.1.4