aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Palimaka <kensington@gentoo.org>2017-07-30 00:44:00 +1000
committerMichael Palimaka <kensington@gentoo.org>2017-07-30 00:48:22 +1000
commit0d238a43f9c36743bbbb02e14fdff1cf9ec58910 (patch)
tree9f25e43ed3afe503076e4758b6c47f5715ba6a9f
parentfrontend: add basic category page (diff)
downloadgrumpy-0d238a43f9c36743bbbb02e14fdff1cf9ec58910.tar.gz
grumpy-0d238a43f9c36743bbbb02e14fdff1cf9ec58910.tar.bz2
grumpy-0d238a43f9c36743bbbb02e14fdff1cf9ec58910.zip
models: add a model for gentoo-ci pkgcheck results
-rw-r--r--backend/lib/models.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/backend/lib/models.py b/backend/lib/models.py
index 010d58f..179a3dd 100644
--- a/backend/lib/models.py
+++ b/backend/lib/models.py
@@ -87,3 +87,17 @@ class Maintainer(db.Model):
def __repr__(self):
return "<Maintainer %s '%s'>" % ("project" if self.is_project else "individual", self.email)
+
+class PkgCheck(db.Model):
+ id = db.Column(db.Integer, primary_key=True)
+ category_id = db.Column(db.Integer, db.ForeignKey('category.id'), nullable=True)
+ category = db.relationship('Category', backref=db.backref('pkgcheck_violations', lazy='select'))
+ package_id = db.Column(db.Integer, db.ForeignKey('package.id'), nullable=True)
+ package = db.relationship('Package', backref=db.backref('pkgcheck_violations', lazy='select'))
+ version_id = db.Column(db.Integer, db.ForeignKey('package_version.id'), nullable=True)
+ version = db.relationship('PackageVersion', backref=db.backref('pkgcheck_violations', lazy='select'))
+ violationclass = db.Column(db.Unicode(30), nullable=False)
+ message = db.Column(db.Unicode(128), nullable=False)
+
+ def __repr__(self):
+ return "<PkgCheck %s/%s-%s %s>" % (self.category.name, self.package.name, self.violationclass)