Implement sql-specific get_last_builds.
authorJelmer Vernooij <jelmer@samba.org>
Wed, 17 Nov 2010 09:18:41 +0000 (10:18 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 17 Nov 2010 09:18:41 +0000 (10:18 +0100)
buildfarm/sqldb.py

index fdee2dd595e28c774f7ce0f8dc1d3dba090c24e8..eebc7d84397b2a202f6e028dd1223574172b0ac9 100644 (file)
@@ -246,6 +246,10 @@ class StormCachingBuildFarm(BuildFarm):
         return self._get_store().find(StormBuild,
             StormBuild.host == host).group_by(StormBuild.compiler, StormBuild.tree)
 
+    def get_last_builds(self, tree):
+        extra_expr = [StormBuild.tree == tree]
+        return self._get_store().find(StormBuild, *extra_expr)
+
     def commit(self):
         self.store.commit()