From 3ff6401723289fb53a2797abd971c25b697822cb Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Mon, 28 Sep 2015 21:45:18 -0700 Subject: bitbake: toaster: Add CustomImageRecipe model This model lists custom image recipes for the project. It is populated when new custom image is created. It holds reference to the base recipe and list of packages included into custom image. For CustomImageRecipes the packages will be copied in and therefore not associated with a build so Remove the requirement for the package to have a Build. co-author: Ed Bartosh (Bitbake rev: 33cbf4cd3b4ca47c4901501f5f1eafdfdfdae023) Signed-off-by: Michael Wood Signed-off-by: brian avery Signed-off-by: Richard Purdie --- bitbake/lib/toaster/orm/models.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/toaster/orm/models.py') diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index b5c864354d..9790630502 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -551,7 +551,7 @@ class Task_Dependency(models.Model): class Package(models.Model): search_allowed_fields = ['name', 'version', 'revision', 'recipe__name', 'recipe__version', 'recipe__license', 'recipe__layer_version__layer__name', 'recipe__layer_version__branch', 'recipe__layer_version__commit', 'recipe__layer_version__local_path', 'installed_name'] - build = models.ForeignKey('Build') + build = models.ForeignKey('Build', null=True) recipe = models.ForeignKey('Recipe', null=True) name = models.CharField(max_length=100) installed_name = models.CharField(max_length=100, default='') @@ -1172,6 +1172,15 @@ class ProjectLayer(models.Model): class Meta: unique_together = (("project", "layercommit"),) +class CustomImageRecipe(models.Model): + name = models.CharField(max_length=100) + base_recipe = models.ForeignKey(Recipe) + packages = models.ManyToManyField(Package) + project = models.ForeignKey(Project) + + class Meta: + unique_together = ("name", "project") + class ProjectVariable(models.Model): project = models.ForeignKey(Project) name = models.CharField(max_length=100) -- cgit v1.2.3-54-g00ecf