From: Michael Wood Date: Wed, 4 Nov 2015 14:54:41 +0000 (+0000) Subject: toaster: orm make CustomImageRecipe inherit from Recipe X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb8120b56be7eee6ed2e4434d8477282a01e0c00;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git toaster: orm make CustomImageRecipe inherit from Recipe 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 Signed-off-by: brian avery --- diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py index 37f78d71021..d1245463abe 100644 --- a/lib/toaster/orm/models.py +++ b/lib/toaster/orm/models.py @@ -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)