summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/orm/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/orm/models.py')
-rw-r--r--bitbake/lib/toaster/orm/models.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 93506d7c1b..c5fe69b883 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -58,6 +58,9 @@ class Target(models.Model):
58 image_size = models.IntegerField(default=0) 58 image_size = models.IntegerField(default=0)
59 license_manifest_path = models.CharField(max_length=500, null=True) 59 license_manifest_path = models.CharField(max_length=500, null=True)
60 60
61 def package_count(self):
62 return Target_Installed_Package.objects.filter(target_id__exact=self.id).count()
63
61 def __str__(self): 64 def __str__(self):
62 return self.target 65 return self.target
63 66
@@ -194,7 +197,7 @@ class Task_Dependency(models.Model):
194 depends_on = models.ForeignKey(Task, related_name='task_dependencies_depends') 197 depends_on = models.ForeignKey(Task, related_name='task_dependencies_depends')
195 198
196class Package(models.Model): 199class Package(models.Model):
197 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__layer__local_path'] 200 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__layer__local_path', 'installed_name']
198 build = models.ForeignKey('Build') 201 build = models.ForeignKey('Build')
199 recipe = models.ForeignKey('Recipe', null=True) 202 recipe = models.ForeignKey('Recipe', null=True)
200 name = models.CharField(max_length=100) 203 name = models.CharField(max_length=100)