]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: orm make CustomImageRecipe inherit from Recipe
authorMichael Wood <michael.g.wood@intel.com>
Wed, 4 Nov 2015 14:54:41 +0000 (14:54 +0000)
committerMichael Wood <michael.g.wood@intel.com>
Mon, 8 Feb 2016 17:30:15 +0000 (17:30 +0000)
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 <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
lib/toaster/orm/models.py

index 37f78d71021f3da981b66a0259cb83d877d86fdd..d1245463abec8297f54b060cebba3b7c4dae79df 100644 (file)
@@ -1383,16 +1383,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)