se-hub/models/TaskComponent.py

26 lines
791 B
Python
Raw Normal View History

2015-06-21 19:34:07 +00:00
__author__ = 'Aran'
import json
from google.appengine.ext import db
class TaskComponent(db.Model):
taskId = db.IntegerProperty(required=True)
userId = db.IntegerProperty(required=True, default = -1)
type = db.StringProperty(required=True,default=" ")
label = db.StringProperty(required=True,default=" ")
isMandatory = db.BooleanProperty(required=True, default=True)
order = db.IntegerProperty(required=True)
2015-06-21 19:34:07 +00:00
def to_JSON(self):
data = {'taskId' : self.taskId,
'userId' : self.userId,
'type' : self.type,
'label' : self.label,
'isMandatory' : self.isMandatory,
2015-06-21 22:38:01 +00:00
'order' : self.order,
'id' : self.key().id()
2015-06-21 19:34:07 +00:00
}
return json.dumps(data)