本文整理匯總了Python中torlite.model.core_tab.CabMember.get方法的典型用法代碼示例。如果您正苦於以下問題:Python CabMember.get方法的具體用法?Python CabMember.get怎麽用?Python CabMember.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類torlite.model.core_tab.CabMember
的用法示例。
在下文中一共展示了CabMember.get方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: check_user
# 需要導入模塊: from torlite.model.core_tab import CabMember [as 別名]
# 或者: from torlite.model.core_tab.CabMember import get [as 別名]
def check_user(self,u_name,u_pass):
tt = CabMember.select().where(CabMember.user_name == u_name).count()
if tt == 0:
return -1
a = CabMember.get(user_name = u_name)
if a.user_pass == hashlib.md5(u_pass.encode('utf-8')).hexdigest():
return 1
return 0
示例2: check_user
# 需要導入模塊: from torlite.model.core_tab import CabMember [as 別名]
# 或者: from torlite.model.core_tab.CabMember import get [as 別名]
def check_user(self, u_name, u_pass):
tt = CabMember.select().where(CabMember.user_name == u_name).count()
if tt == 0:
return -1
a = CabMember.get(user_name=u_name)
if a.user_pass == tools.md5(u_pass):
return 1
return 0
示例3: get_by_id
# 需要導入模塊: from torlite.model.core_tab import CabMember [as 別名]
# 或者: from torlite.model.core_tab.CabMember import get [as 別名]
def get_by_id(self, uname):
try:
return CabMember.get(user_name=uname)
except:
return False
示例4: get_by_uid
# 需要導入模塊: from torlite.model.core_tab import CabMember [as 別名]
# 或者: from torlite.model.core_tab.CabMember import get [as 別名]
def get_by_uid(self, uid):
try:
return CabMember.get(CabMember.uid == uid)
except:
return False
示例5: get_by_email
# 需要導入模塊: from torlite.model.core_tab import CabMember [as 別名]
# 或者: from torlite.model.core_tab.CabMember import get [as 別名]
def get_by_email(self, emai):
print(emai)
try:
return CabMember.get(user_email=emai)
except:
return False