This allows us to re-use the properties of a recipe for the custom image
recipes as well as re-using the existing templates and logic that deals
with recipe objects.

Signed-off-by: Michael Wood <[email protected]>
---
 bitbake/lib/toaster/orm/models.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/bitbake/lib/toaster/orm/models.py 
b/bitbake/lib/toaster/orm/models.py
index 10f1cce..debe6fa 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -1243,16 +1243,11 @@ class ProjectLayer(models.Model):
     class Meta:
         unique_together = (("project", "layercommit"),)
 
-class CustomImageRecipe(models.Model):
+class CustomImageRecipe(Recipe):
     search_allowed_fields = ['name']
-    name = models.CharField(max_length=100)
-    base_recipe = models.ForeignKey(Recipe)
-    packages = models.ManyToManyField(Package)
+    base_recipe = models.ForeignKey(Recipe, related_name='based_on_recipe')
     project = models.ForeignKey(Project)
 
-    class Meta:
-        unique_together = ("name", "project")
-
 class ProjectVariable(models.Model):
     project = models.ForeignKey(Project)
     name = models.CharField(max_length=100)
-- 
2.1.4

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

Reply via email to