Skip to contentSkip to conversation

quick question on double key queries

DISCUSSION Barros Pena, Belen 1 participant 1 message Jan 10, 2014

lore
Share & tools
lore
#0 lore raw
Quoted 10 lines · David

Hi Alex,

Your advice worked!

View:
tasks = Task.objects.filter(recipe_id = recipe_id).filter(build_id =
build_id)
packages = Package.objects.filter(recipe_id =
recipe_id).filter(build_id = build_id)

Quoted 5 lines

By the way, for the ³task_executed³ member you have this comment in your model for ³Task², but no ³choices² human-string mappings. Should the GUI show display
to ³Executed²/³Prebuilt² or what Belen used which was ³Executed²/²Not executed².

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én

Quoted 83 lines

task_executed = models.BooleanField(default=False) # True means
Executed, False means Prebuilt

- David

From: Damian, Alexandru [mailto:[email protected]]

Sent: Wednesday, January 08, 2014 7:40 AM
To: Reyna, David
Cc: [email protected]
Subject: Re: quick question on double key queries

I'd try:

tasks = Task.objects.filter(recipe_id = recipe_id).filter(build_id =
build_id)

I suppose the recipe_id and build_id are coming from the frontend through GET parameters ?

Alex

On Wed, Jan 8, 2014 at 11:17 AM, Reyna, David <[email protected]> wrote:
Hi Alex,

Perhaps you can answer this easily? I would like to filter the ³Task² data base for the records that match a given recipe_id. It appears that I need to filter for both the
FK¹s ³recipe_id² and ³build_id².

How do I set up that query? I do not think that this is correct:

def recipe(request, build_id, recipe_id):

Š

tasks = Task.objects.filter(recipe_id=recipe_id, build_id=build_id)

Thanks,

David

Signature · 4 lines
Alex Damian
Yocto Project

SSG / OTC