From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id C2233E00D26; Thu, 16 Jun 2016 07:04:11 -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,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [74.125.82.47 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 4F343E00D15 for ; Thu, 16 Jun 2016 07:04:05 -0700 (PDT) Received: by mail-wm0-f47.google.com with SMTP id a66so59678613wme.0 for ; Thu, 16 Jun 2016 07:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=p2dA8g/38X9IJfb1BE96eNuEV/4X7PxmGBwvLoyOWg8=; b=zlTLUXyjlinq0xj/OrF9av4v9q0DMG8sOjdLxR3eWlUwS51d8Xd0GO7bUMOZbbDHAz iDK79jHLmhhZm2DtdiIr9F2T+gbJZuFuEp+z7HqIexLQ5rs13OWKA5+Ig9XxWQKG1KHZ D+AWbGCkhRBN6QZZm9CmMeb4+kDsUExNcbhDGB59Dsuae+8y73GrU+8dBTow8OZosdwH 69C4Q1UGguYmcKIihJ1f4lddVYh+zgMmihSxXzm03YL8/Yztm5Nc2Cr8Vb319wA9slGk hvvxMAwcawciuvvTaoWBi7ZaBFJEw5JB3mztbyFd6DwPm5k73bA+4y2ehBO59Q363cgc h8hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=p2dA8g/38X9IJfb1BE96eNuEV/4X7PxmGBwvLoyOWg8=; b=I974whFOkXCDs3YVM46ZBERZKUR+milRzyJQ56vkBbXnTs3JnUBgIkEQUWSs8lAn3p hvfRiEjp/G5PGp1B6mkmKHFjTMUCgqDv6EyN8EVuGQVdfZEas6/c8brpREB/g1Ua7qnt srTC9+4gJD04OzqguKKPfw54/Q9eo8iwrEXbzkHx59zDE47OYonsCiXiNByr4dBNaUOt 7p8IcpCEgOiiiYA+JJ0KaWSJZ6qrrC5Ov3zM8Djm7Kh7IY3524XhAgUMGKcwn/G7WqsL 5DGQ6jf8W7MhTLvcND0nD/bqNArM8JTCpVSTUtCVi00ixRjVZUAGPbmZ3tc2WjYCYE1Y goHw== X-Gm-Message-State: ALyK8tJ6plf8T04MNvxx0UxNHxsy5U7uyNkngSnikMCwxzJQkxVmSH1pRl91xyqqArvVir5A X-Received: by 10.28.58.6 with SMTP id h6mr5357088wma.101.1466085843996; Thu, 16 Jun 2016 07:04:03 -0700 (PDT) Received: from [192.168.0.78] (host86-169-85-169.range86-169.btcentralplus.com. [86.169.85.169]) by smtp.googlemail.com with ESMTPSA id b200sm15071520wmb.9.2016.06.16.07.04.03 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 16 Jun 2016 07:04:03 -0700 (PDT) From: Michael Wood To: "toaster@yoctoproject.org" References: <1466084896-27129-1-git-send-email-elliot.smith@intel.com> Message-ID: <5762B1D3.1030303@intel.com> Date: Thu, 16 Jun 2016 15:04:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <1466084896-27129-1-git-send-email-elliot.smith@intel.com> Subject: Re: [PATCH] toaster: fix typo which causes table searches to fail 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, 16 Jun 2016 14:04:11 -0000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Looks good to me. Send to bitbake-devel and applied to toaster-next. Thanks, Michael On 16/06/16 14:48, Elliot Smith wrote: > The iterator used to create a search query refers to a > variable "x" which isn't set, causing an "'x' is not defined" error > and preventing table searches (on non-ToasterTables) from working. > > Use the "field" variable instead, which contains the name of the > field to add to the query. > > [YOCTO #9749] > > Signed-off-by: Elliot Smith > --- > bitbake/lib/toaster/toastergui/views.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py > index 0254876..28ff67b 100755 > --- a/bitbake/lib/toaster/toastergui/views.py > +++ b/bitbake/lib/toaster/toastergui/views.py > @@ -324,7 +324,7 @@ def _get_search_results(search_term, queryset, model): > for st in search_term.split(" "): > queries = None > for field in model.search_allowed_fields: > - query = Q(**{x+'__icontains': st}) > + query = Q(**{field + '__icontains': st}) > queries = queries | query if queries else query > > search_object = search_object & queries if search_object else queries