def get_person(user_id):
# Check if user exists
S = Query()
person = db.search(S.user_id == user_id)
if len(person) is 0:
usr = {"user_id": user_id,
"word_count": DEFAULT_WORD_COUNT,
"prefixes": DEFAULT_PREFIX_SUFFIX,
"separators": DEFAULT_SEPARATOR}
db.insert(usr)
return usr
return person[0]
dbworker.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录