Return-Path: Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 6C0FAE00859 for ; Fri, 10 Jan 2014 02:37:13 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by azsmga102.ch.intel.com with ESMTP; 10 Jan 2014 02:37:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,637,1384329600"; d="scan'208";a="456628169" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga001.fm.intel.com with ESMTP; 10 Jan 2014 02:36:58 -0800 Received: from irsmsx153.ger.corp.intel.com (163.33.192.75) by IRSMSX104.ger.corp.intel.com (163.33.3.159) with Microsoft SMTP Server (TLS) id 14.3.123.3; Fri, 10 Jan 2014 10:36:56 +0000 Received: from irsmsx106.ger.corp.intel.com ([169.254.8.188]) by IRSMSX153.ger.corp.intel.com ([169.254.9.156]) with mapi id 14.03.0123.003; Fri, 10 Jan 2014 10:36:56 +0000 From: "Barros Pena, Belen" To: "Reyna, David L (Wind River)" , "Damian, Alexandru" Thread-Topic: [Toaster] quick question on double key queries Thread-Index: AQHPDe/h261MWARrNk+dSqWYrIXg1Q== Date: Fri, 10 Jan 2014 10:36:55 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.9.131030 x-originating-ip: [10.237.224.31] MIME-Version: 1.0 Cc: "toaster@yoctoproject.org" Subject: Re: quick question on double key queries 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: Fri, 10 Jan 2014 10:37:16 -0000 Content-Language: en-US Content-Type: text/plain; charset="Windows-1252" Content-ID: <4FDDF65EDEA01B43A3B6E7DCF9A1EF83@intel.com> Content-Transfer-Encoding: quoted-printable On 10/01/2014 07:46, "Reyna, David" wrote: >Hi Alex, >=20 >Your advice worked! >=20 >View: > tasks =3D Task.objects.filter(recipe_id =3D recipe_id).filter(build_i= d =3D >build_id) > packages =3D Package.objects.filter(recipe_id =3D >recipe_id).filter(build_id =3D build_id) >=20 >By the way, for the =B3task_executed=B3 member you have this comment in yo= ur >model for =B3Task=B2, but no =B3choices=B2 human-string mappings. Should t= he GUI >show display > to =B3Executed=B2/=B3Prebuilt=B2 or what Belen used which was =B3Executed= =B2/=B2Not >executed=B2. We are still evaluating if we will be able to make the changes on how we classify tasks within 1.6. For the moment, showing what the db currently stores (Executed / Prebuilt) will do. Cheers Bel=E9n >=20 > task_executed =3D models.BooleanField(default=3DFalse) # True means >Executed, False means Prebuilt >=20 >- David >=20 >=20 >From: Damian, Alexandru [mailto:alexandru.damian@intel.com] > >Sent: Wednesday, January 08, 2014 7:40 AM >To: Reyna, David >Cc: toaster@yoctoproject.org >Subject: Re: quick question on double key queries > > >=20 >I'd try: >=20 > > tasks =3D Task.objects.filter(recipe_id =3D recipe_id).filter(build_id= =3D >build_id) > >=20 > >I suppose the recipe_id and build_id are coming from the frontend through >GET parameters ?=20 > >=20 > >Alex > > >=20 >On Wed, Jan 8, 2014 at 11:17 AM, Reyna, David >wrote: >Hi Alex, > >=20 > >Perhaps you can answer this easily? I would like to filter the =B3Task=B2 >data base for the records that match a given recipe_id. It appears that I >need to filter for both the > FK=B9s =B3recipe_id=B2 and =B3build_id=B2. > >=20 > >How do I set up that query? I do not think that this is correct: > >=20 > >def recipe(request, build_id, recipe_id): > > =8A > > tasks =3D Task.objects.filter(recipe_id=3Drecipe_id, build_id=3Dbuild= _id) > >=20 > >Thanks, > >David > >=20 > >=20 > > > > > > >=20 > >--=20 >Alex Damian >Yocto Project > >SSG / OTC=20 > > > > >