From 7729b3d884a42f8ae1bf290c1c03752695096afe Mon Sep 17 00:00:00 2001 From: aranzaiger Date: Sun, 21 Jun 2015 22:34:07 +0300 Subject: [PATCH] taskComponents --- models/TaskComponent.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 models/TaskComponent.py diff --git a/models/TaskComponent.py b/models/TaskComponent.py new file mode 100644 index 0000000..f2130b2 --- /dev/null +++ b/models/TaskComponent.py @@ -0,0 +1,32 @@ +__author__ = 'Aran' + + +import json +from google.appengine.ext import db + + +class TaskComponent(db.Model): + taskId = db.StringProperty(required=True) + courseName = db.StringProperty(required=True) + description = db.StringProperty(required=True,default=" ") + dueDate = db.DateProperty(required=True) + #isProject = db.BooleanProperty(required=False) + isClose = db.BooleanProperty(required=True, default=False) + isDone = db.BooleanProperty(required=True, default=False) + taskGrade = db.IntegerProperty(required=True, default=0) + + def to_JSON(self): + data = {'title' : self.title, + 'courseName' : self.courseName, + 'description' : self.description, + 'dueDate' : { + 'year': self.dueDate.year, + 'month': self.dueDate.month, + 'day': self.dueDate.day + }, + #'isProject' : self.isProject, + 'isClose' : self.isClose, + 'isDone' : self.isDone, + 'taskGrade' : self.taskGrade, + } + return json.dumps(data)