25 lines
No EOL
862 B
Python
25 lines
No EOL
862 B
Python
import json
|
|
|
|
__author__ = 'Aran'
|
|
from google.appengine.ext import db
|
|
|
|
class User(db.Model):
|
|
username = db.StringProperty(required=True)
|
|
name = db.StringProperty(required=True)
|
|
email = db.StringProperty(required=True)
|
|
isLecturer = db.BooleanProperty(required=True)
|
|
accsessToken = db.StringProperty(required=True)
|
|
seToken = db.StringProperty(required=True)
|
|
avatar_url = db.StringProperty(required=True)
|
|
isFirstLogin = db.BooleanProperty(default=True)
|
|
|
|
def to_JSON(self):
|
|
dick = {'username' : self.username,
|
|
'name' : self.name,
|
|
'email' : self.email,
|
|
'isLecturer' : self.isLecturer,
|
|
'seToken' : self.seToken,
|
|
'avatar_url' : self.avatar_url,
|
|
'isFirstLogin' : self.isFirstLogin,
|
|
}
|
|
return json.dumps(dick) |