Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Add the task model
Browse files Browse the repository at this point in the history
  • Loading branch information
tdemin committed Jun 7, 2019
1 parent 63c1d5b commit 55ae1b4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions project_amber/models/task.py
@@ -0,0 +1,15 @@
from project_amber.db import db

class Task(db.Model):
"""
Task model. Contains a task ID, the owner, the subject, and the lastmod /
creation time.
"""
id = db.Column(db.Integer, primary_key=True)
owner = db.Column(db.Integer, db.ForeignKey("user.id"), nullable=False)
text = db.Column(db.String(65536)) # TODO: probably subject to increase
creation_time = db.Column(db.Integer, nullable=False)
last_mod_time = db.Column(db.Integer, nullable=False)
def __repr__(self):
return "<Task id='%d' owner='%d' text='%s' creation_time='%d'>" \
% self.id, self.owner, self.text, self.creation_time

0 comments on commit 55ae1b4

Please sign in to comment.