Skip to contentSkip to conversation

remove custom images from Image Recipes page

review-request version2 In review Dave Lerner 3 participants 4 messages Feb 22, 2016 – Feb 23, 2016

lore
Share & tools
lore
#0 lore raw

Branch: master
Defect: bz9111
Summary: don't show custom images on Configuration | Image Recipes page

Tests
-----
Create custom image xxxxx based on core-image-minimal and build it. View Image Recipes page.
Verify that core-image-minimal is in the list and
verify that xxxxx is not in the list.

View custom image page.
Verify that xxxxx *is* in the list.

#1 lore raw

PATCH 1/1 toaster: remove custom images from Image Recipes

Fix the view of 'Image Recipes' under 'Configuration' to only show image recipes that are not customised since custom images have their own page.

[YOCTO #9111]

---
 bitbake/lib/toaster/toastergui/tables.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
bitbake/lib/toaster/toastergui/tables.py +4 -1
index 86d111d..48a55de 100644
@@ -549,7 +549,10 @@ class ImageRecipesTable(RecipesTable):
     def setup_queryset(self, *args, **kwargs):
         super(ImageRecipesTable, self).setup_queryset(*args, **kwargs)
 
-        self.queryset = self.queryset.filter(is_image=True)
+        custom_image_recipes = CustomImageRecipe.objects.filter(
+                project=kwargs['pid'])
+        self.queryset = self.queryset.filter(
+                Q(is_image=True) & ~Q(pk__in=custom_image_recipes))
         self.queryset = self.queryset.order_by(self.default_orderby)
 
 
Signature · 1 line
1.9.1
#2 lore raw

Re: [PATCH 1/1 Version 2] toaster: remove custom images from Image Recipes

Quoted 5 lines · On 23/02/2016 00:16, "[email protected] on behalf of Dave…

Fix the view of 'Image Recipes' under 'Configuration' to only show image recipes that are not customised since custom images have their own page.

[YOCTO #9111]

From the UI side of things, this is good.

Thanks!

Belén

Quoted 31 lines

---
bitbake/lib/toaster/toastergui/tables.py | 5 ++++-

1 file changed, 4 insertions(+), 1 deletion(-)
bitbake/lib/toaster/toastergui/tables.py +4 -1
index 86d111d..48a55de 100644
@@ -549,7 +549,10 @@ class ImageRecipesTable(RecipesTable):
    def setup_queryset(self, *args, **kwargs):
        super(ImageRecipesTable, self).setup_queryset(*args, **kwargs)
 
-        self.queryset = self.queryset.filter(is_image=True)
+        custom_image_recipes = CustomImageRecipe.objects.filter(
+                project=kwargs['pid'])
+        self.queryset = self.queryset.filter(
+                Q(is_image=True) & ~Q(pk__in=custom_image_recipes))
        self.queryset = self.queryset.order_by(self.default_orderby)
 
 
Signature · 7 lines
1.9.1

-- 
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster
#3 lore raw

Re: [PATCH 1/1 Version 2] toaster: remove custom images from Image Recipes

Thanks patch sent to bitbake-devel and pushed to toaster-next

Quoted 46 lines · Belen
Quoted 5 lines · On 23/02/2016 00:16, "[email protected] on behalf of Dave…

Fix the view of 'Image Recipes' under 'Configuration' to only show image recipes that are not customised since custom images have their own page.

[YOCTO #9111]

From the UI side of things, this is good.

Thanks!

Belén

Quoted 30 lines

---
bitbake/lib/toaster/toastergui/tables.py | 5 ++++-

1 file changed, 4 insertions(+), 1 deletion(-)
bitbake/lib/toaster/toastergui/tables.py +4 -1
index 86d111d..48a55de 100644
@@ -549,7 +549,10 @@ class ImageRecipesTable(RecipesTable):
     def setup_queryset(self, *args, **kwargs):
         super(ImageRecipesTable, self).setup_queryset(*args, **kwargs)
 
-        self.queryset = self.queryset.filter(is_image=True)
+        custom_image_recipes = CustomImageRecipe.objects.filter(
+                project=kwargs['pid'])
+        self.queryset = self.queryset.filter(
+                Q(is_image=True) & ~Q(pk__in=custom_image_recipes))
         self.queryset = self.queryset.order_by(self.default_orderby)
 
 
Signature · 7 lines
1.9.1

-- 
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster