commit: a46c779bf33cf558d287f8bcf11a5e483046bb17 Author: Mart Raudsepp <leio <AT> gentoo <DOT> org> AuthorDate: Sun Dec 4 05:24:45 2016 +0000 Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org> CommitDate: Sun Dec 4 05:25:29 2016 +0000 URL: https://gitweb.gentoo.org/proj/grumpy.git/commit/?id=a46c779b
models: Add Maintainer model As this is a new table, just re-doing "./manage.py init" should add it to db, while keeping old data. backend/lib/models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backend/lib/models.py b/backend/lib/models.py index 57f3e64..bc6cd20 100644 --- a/backend/lib/models.py +++ b/backend/lib/models.py @@ -30,3 +30,14 @@ class PackageVersion(db.Model): def __repr__(self): return "<PackageVersion '%s/%s-%s'>" % (self.package.category.name, self.package.name, self.version) + +class Maintainer(db.Model): + id = db.Column(db.Integer, primary_key=True) + email = db.Column(db.Unicode(50), nullable=False, unique=True) + is_project = db.Column(db.Boolean, nullable=False, server_default='f', default=False) + name = db.Column(db.Unicode(128)) + url = db.Column(db.Unicode()) + description = db.Column(db.Unicode(500)) + + def __repr__(self): + return "<Maintainer %s '%s'>" % ("project" if self.is_project else "individual", self.email)