[Pkg-debile-commits] [debile-master] 55/126: server update
Sylvestre Ledru
sylvestre at alioth.debian.org
Mon Aug 19 14:56:14 UTC 2013
This is an automated email from the git hooks/post-receive script.
sylvestre pushed a commit to branch scan-build-html
in repository debile-master.
commit 0151027d1e26ce4c153c91e9c0a3608d401ef659
Author: Paul Tagliamonte <tag at pault.ag>
Date: Fri May 31 22:14:03 2013 -0400
server update
---
lucy/models/job.py | 10 ++++++++++
lucy/models/report.py | 4 ++--
lucy/models/source.py | 6 ++++++
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/lucy/models/job.py b/lucy/models/job.py
index 3261604..bdfc551 100644
--- a/lucy/models/job.py
+++ b/lucy/models/job.py
@@ -46,6 +46,11 @@ class Job(LucyObject):
if self['package_type'] == 'source':
return Source.load(self['package'])
+ def get_reports(self):
+ from lucy.models.report import Report
+ for x in Report.query({"job": self['_id']}):
+ yield x
+
def get_builder(self):
builder = self.get('builder', None)
if builder is None:
@@ -85,6 +90,11 @@ class Job(LucyObject):
yield x
@classmethod
+ def by_package(cls, package, **kwargs):
+ for x in cls.query({"package": package}):
+ yield x
+
+ @classmethod
def unfinished_jobs(cls, **kwargs):
k = kwargs.copy()
k.update({"finished_at": None})
diff --git a/lucy/models/report.py b/lucy/models/report.py
index 331b635..67943ba 100644
--- a/lucy/models/report.py
+++ b/lucy/models/report.py
@@ -32,7 +32,7 @@ class Report(LucyObject):
builder = Machine.load(builder)['_id']
- job = Job.load(job)['_id']
+ job = Job.load(job)
if type is None:
type = job['type']
@@ -41,7 +41,7 @@ class Report(LucyObject):
builder=builder,
package=loaded_package['_id'],
report=report,
- job=job,
+ job=job['_id'],
type=type,
failed=failed,
**kwargs)
diff --git a/lucy/models/source.py b/lucy/models/source.py
index a78b220..1ef7c6d 100644
--- a/lucy/models/source.py
+++ b/lucy/models/source.py
@@ -1,5 +1,6 @@
from lucy.models import LucyObject
from lucy.models.user import User
+from lucy.models.job import Job
class Source(LucyObject):
@@ -11,3 +12,8 @@ class Source(LucyObject):
version=version,
owner=owner,
**kwargs)
+
+
+ def get_pending_jobs(self):
+ for x in Job.by_package(self['_id']):
+ yield x
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-debile/debile-master.git
More information about the Pkg-debile-commits
mailing list