Skip to contentSkip to conversation

remove custom images from Image Recipes page

review-request In review Dave Lerner 3 participants 5 messages Feb 19, 2016 – Feb 22, 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.

#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

---
 bitbake/lib/toaster/toastergui/tables.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
bitbake/lib/toaster/toastergui/tables.py +3 -1
index 86d111d..50a18e7 100644
@@ -549,7 +549,9 @@ 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.all()
+        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] toaster: remove custom images from Image Recipes

Quoted 15 lines · On 19/02/2016 23:32, "[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

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

1 file changed, 3 insertions(+), 1 deletion(-)
bitbake/lib/toaster/toastergui/tables.py +0 -0
index 86d111d..50a18e7 100644

bitbake/lib/toaster/toastergui/tables.py class ImageRecipesTable(RecipesTable): · line 555

Quoted 8 lines
bitbake/lib/toaster/toastergui/tables.py +3 -1
@@ -549,7 +549,9 @@ 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.all()
+        self.queryset = self.queryset.filter(
+                Q(is_image=True) & ~Q(pk__in=custom_image_recipes))
        self.queryset = self.queryset.order_by(self.default_orderby)

This patch removes the custom images from the compatible image recipes list (as requested by issue 9111), but also from the new custom image page. I think it might be useful to be able to create custom images selecting a custom image as your base image (for example, I might want to create a minimal-belen-dev from my minimal-belen custom image).

If this is something we'd like to keep, we would need to modify the patch to remove the custom images from the compatible image recipes list, but not from the new custom image page.

Thanks!

Belén

Quoted 10 lines
Signature · 8 lines
-- 
1.9.1

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

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

Quoted 24 lines · Belen
Quoted 18 lines · On 19/02/2016 23:32, "[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

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

1 file changed, 3 insertions(+), 1 deletion(-)
bitbake/lib/toaster/toastergui/tables.py +0 -0
index 86d111d..50a18e7 100644
@@ -549,7 +549,9 @@ class ImageRecipesTable(RecipesTable):
    def setup_queryset(self, *args, **kwargs):
        super(ImageRecipesTable, self).setup_queryset(*args, **kwargs)
 
Quoted 9 lines

bitbake/lib/toaster/toastergui/tables.py class ImageRecipesTable(RecipesTable): · line 555

Quoted 5 lines
bitbake/lib/toaster/toastergui/tables.py +3 -1
-        self.queryset = self.queryset.filter(is_image=True)
+        custom_image_recipes = CustomImageRecipe.objects.all()
+        self.queryset = self.queryset.filter(
+                Q(is_image=True) & ~Q(pk__in=custom_image_recipes))
        self.queryset = self.queryset.order_by(self.default_orderby)

This patch removes the custom images from the compatible image recipes list (as requested by issue 9111), but also from the new custom image page.

Sorry, my mistake: the custom images do appear in the new custom image page. Mondays ...

Belén

Quoted 23 lines

I think it might be useful to be able to create custom images selecting a custom image as your base image (for example, I might want to create a minimal-belen-dev from my minimal-belen custom image).

If this is something we'd like to keep, we would need to modify the patch to remove the custom images from the compatible image recipes list, but not from the new custom image page.

Thanks!

Belén

Quoted 10 lines
Signature · 8 lines
-- 
1.9.1

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

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

In reply to Dave Lerner
Quoted 14 lines · Dave Lerner

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

---
  bitbake/lib/toaster/toastergui/tables.py | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
bitbake/lib/toaster/toastergui/tables.py +0 -0
index 86d111d..50a18e7 100644

bitbake/lib/toaster/toastergui/tables.py class ImageRecipesTable(RecipesTable): · line 552

Quoted 5 lines
bitbake/lib/toaster/toastergui/tables.py +1 -1
@@ -549,7 +549,9 @@ 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.all()

One minor thing, we can make this QuerySet a bit more lightweight by using the project field e.g. CustomImageRecipe.objects.filter(project=kwargs['pid']) so that we're only doing a query of all in the current project.

Quoted 5 lines
bitbake/lib/toaster/toastergui/tables.py +2 -0
+        self.queryset = self.queryset.filter(
+                Q(is_image=True) & ~Q(pk__in=custom_image_recipes))
          self.queryset = self.queryset.order_by(self.default_orderby)