def getTokenObj(tokenk): e = AuthRecord.get_by_id(tokenk) t = {} t['key'] = e.t_key t['secret'] = e.t_secret return DictObj(t)
def setuid(tokenk, uid): e = AuthRecord.get_by_id(tokenk) e.uid = int(str(uid)) e.put()
def markAuthUsed(tokenk): e = AuthRecord.get_by_id(tokenk) e.used = True e.put()
def setNewAuthRecord(uid, t_key, t_secret): ar = AuthRecord(id = t_key, uid = uid, t_key = t_key, t_secret = t_secret, used = False) ar.put()