2015-06-10 18:39:42 +00:00
|
|
|
import json
|
2015-06-21 19:19:24 +00:00
|
|
|
import time
|
2015-06-10 18:39:42 +00:00
|
|
|
__author__ = 'Aran'
|
|
|
|
from google.appengine.ext import db
|
|
|
|
|
2015-06-21 19:19:24 +00:00
|
|
|
|
2015-06-10 18:39:42 +00:00
|
|
|
class Task(db.Model):
|
|
|
|
title = db.StringProperty(required=True)
|
2015-06-29 10:40:11 +00:00
|
|
|
courseId = db.IntegerProperty(required=True)
|
2015-06-18 18:30:09 +00:00
|
|
|
description = db.StringProperty(required=True,default=" ")
|
2015-06-10 18:39:42 +00:00
|
|
|
dueDate = db.DateProperty(required=True)
|
2015-06-21 20:53:39 +00:00
|
|
|
isPersonal = db.BooleanProperty(required=True, default=True)
|
2015-06-10 18:39:42 +00:00
|
|
|
|
|
|
|
def to_JSON(self):
|
|
|
|
data = {'title' : self.title,
|
2015-06-29 10:40:11 +00:00
|
|
|
'courseId' : self.courseId,
|
2015-06-10 18:39:42 +00:00
|
|
|
'description' : self.description,
|
2015-06-21 19:19:24 +00:00
|
|
|
'dueDate' : {
|
|
|
|
'year': self.dueDate.year,
|
|
|
|
'month': self.dueDate.month,
|
|
|
|
'day': self.dueDate.day
|
|
|
|
},
|
2015-06-21 20:53:39 +00:00
|
|
|
'isPersonal' : self.isPersonal,
|
2015-06-21 22:38:01 +00:00
|
|
|
'id' : self.key().id()
|
2015-06-10 18:39:42 +00:00
|
|
|
}
|
|
|
|
return json.dumps(data)
|
2015-06-21 19:19:24 +00:00
|
|
|
|