summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/models.py')
-rw-r--r--bitbake/lib/toaster/bldcontrol/models.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/models.py b/bitbake/lib/toaster/bldcontrol/models.py
index 2386d2345a..dc4afca2f7 100644
--- a/bitbake/lib/toaster/bldcontrol/models.py
+++ b/bitbake/lib/toaster/bldcontrol/models.py
@@ -113,6 +113,15 @@ class BuildRequest(models.Model):
113 created = models.DateTimeField(auto_now_add = True) 113 created = models.DateTimeField(auto_now_add = True)
114 updated = models.DateTimeField(auto_now = True) 114 updated = models.DateTimeField(auto_now = True)
115 115
116 def get_duration(self):
117 return (self.updated - self.created).total_seconds()
118
119 def get_sorted_target_list(self):
120 tgts = self.brtarget_set.order_by( 'target' );
121 return( tgts );
122
123 def get_machine(self):
124 return self.brvariable_set.get(name="MACHINE").value
116 125
117# These tables specify the settings for running an actual build. 126# These tables specify the settings for running an actual build.
118# They MUST be kept in sync with the tables in orm.models.Project* 127# They MUST be kept in sync with the tables in orm.models.Project*