本文整理汇总了Python中torlite.model.core_tab.CabMember类的典型用法代码示例。如果您正苦于以下问题:Python CabMember类的具体用法?Python CabMember怎么用?Python CabMember使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CabMember类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: insert_data
def insert_data(self, post_data):
if '/' in post_data['user_name'][0]:
return False
if ':' in post_data['user_name'][0]:
return False
if len(post_data['user_name'][0]) < 5 or len(post_data['user_name'][0]) > 20:
return False
if '\\' in post_data['user_name'][0]:
return False
if '#' in post_data['user_name'][0]:
return False
if '+' in post_data['user_name'][0]:
return False
if "'" in post_data['user_name'][0]:
return False
if '"' in post_data['user_name'][0]:
return False
if '(' in post_data['user_name'][0]:
return False
if ')' in post_data['user_name'][0]:
return False
if ' ' in post_data['user_name'][0]:
return False
try:
CabMember.create(uid=tools.get_uuid(),
user_name=post_data['user_name'][0],
user_pass=tools.md5(post_data['user_pass'][0]),
user_email=post_data['user_email'][0],
privilege='10000',
reset_passwd_timestamp=0, )
return True
except:
return False
开发者ID:vaveee,项目名称:TorCMS,代码行数:34,代码来源:muser.py
示例2: check_user
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
开发者ID:jiajie999,项目名称:TorCMS,代码行数:8,代码来源:muser.py
示例3: check_user
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
开发者ID:net4nt,项目名称:TorCMS,代码行数:8,代码来源:muser.py
示例4: insert_data
def insert_data(self, post_data):
try:
CabMember.create(uid=tools.get_uuid(),
user_name=post_data['user_name'][0],
user_pass=tools.md5(post_data['user_pass'][0]),
user_email=post_data['user_email'][0],
privilege='10000',
reset_passwd_timestamp=0, )
return True
except:
return False
开发者ID:net4nt,项目名称:TorCMS,代码行数:11,代码来源:muser.py
示例5: update_reset_passwd_timestamp
def update_reset_passwd_timestamp(self, uname, timeit):
entry = CabMember.update(
reset_passwd_timestamp = timeit,
).where(CabMember.user_name == uname)
entry.execute()
return entry
开发者ID:Ryan007,项目名称:TorCMS,代码行数:7,代码来源:muser.py
示例6: update_info
def update_info(self, u_name, newemail):
entry = CabMember.update(
user_email=newemail,
).where(CabMember.user_name == u_name)
entry.execute()
return entry
开发者ID:net4nt,项目名称:TorCMS,代码行数:7,代码来源:muser.py
示例7: delete_by_user_name
def delete_by_user_name(self, user_name):
try:
del_count = CabMember.delete().where(CabMember.user_name == user_name)
del_count.execute()
return True
except:
return False
开发者ID:vaveee,项目名称:TorCMS,代码行数:7,代码来源:muser.py
示例8: delete
def delete(self, del_id):
try:
del_count = CabMember.delete().where(CabMember.uid == del_id)
del_count.execute()
return True
except:
return False
开发者ID:net4nt,项目名称:TorCMS,代码行数:7,代码来源:muser.py
示例9: update_privilege
def update_privilege(self, u_name, newprivilege):
print(u_name)
entry = CabMember.update(
privilege=newprivilege
).where(CabMember.user_name == u_name)
entry.execute()
return entry
开发者ID:Ryan007,项目名称:TorCMS,代码行数:9,代码来源:muser.py
示例10: insert_data
def insert_data(self, post_data):
uu = CabMember.select().aggregate(peewee.fn.Max(CabMember.uid))
if uu:
pass
else:
uu = 0
try:
entry = CabMember.create(
uid = uu + 1,
user_name = post_data['user_name'][0],
user_pass =hashlib.md5(post_data['user_pass'][0].encode('utf-8')).hexdigest() ,
user_email = post_data['user_email'][0]
)
return True
except:
return False
开发者ID:ifcheung2012,项目名称:TorCMS,代码行数:18,代码来源:muser.py
示例11: insert_data
def insert_data(self, post_data):
print(post_data)
print(type(post_data['user_name'][0]))
print(type(post_data['user_email'][0]))
entry = CabMember.create(uid=tools.get_uuid(),
user_name=post_data['user_name'][0],
user_pass=hashlib.md5(post_data['user_pass'][0].encode('utf-8')).hexdigest(),
user_email=post_data['user_email'][0],
privilege='10000')
return True
开发者ID:Ryan007,项目名称:TorCMS,代码行数:10,代码来源:muser.py
示例12: insert_data
def insert_data(self, post_data):
try:
entry = CabMember.create(
uid = tools.get_uuid(),
user_name = post_data['user_name'][0],
user_pass =hashlib.md5(post_data['user_pass'][0].encode('utf-8')).hexdigest() ,
user_email = post_data['user_email'][0]
)
return True
except:
return False
开发者ID:jiajie999,项目名称:TorCMS,代码行数:12,代码来源:muser.py
示例13: update_pass
def update_pass(self,u_name, newpass):
entry = CabMember.update(
user_pass = hashlib.md5(newpass.encode('utf-8')).hexdigest() ,
).where(CabMember.user_name == u_name)
entry.execute()
return entry
开发者ID:jiajie999,项目名称:TorCMS,代码行数:6,代码来源:muser.py
示例14: get_by_id
def get_by_id(self, uname):
try:
return CabMember.get(user_name=uname)
except:
return False
开发者ID:jiajie999,项目名称:TorCMS,代码行数:5,代码来源:muser.py
示例15: get_by_uid
def get_by_uid(self, uid):
try:
return CabMember.get(CabMember.uid == uid)
except:
return False
开发者ID:jiajie999,项目名称:TorCMS,代码行数:5,代码来源:muser.py
示例16: __init__
def __init__(self):
try:
CabMember.create_table()
except:
pass
开发者ID:jiajie999,项目名称:TorCMS,代码行数:5,代码来源:muser.py
示例17: get_by_keyword
def get_by_keyword(self, par2):
return CabMember.select().where(CabMember.user_name.contains(par2))
开发者ID:net4nt,项目名称:TorCMS,代码行数:2,代码来源:muser.py
示例18: update_pass
def update_pass(self, u_name, newpass):
entry = CabMember.update(
user_pass=tools.md5(newpass),
).where(CabMember.user_name == u_name)
entry.execute()
return entry
开发者ID:net4nt,项目名称:TorCMS,代码行数:6,代码来源:muser.py
示例19: get_by_email
def get_by_email(self, emai):
print(emai)
try:
return CabMember.get(user_email=emai)
except:
return False
开发者ID:net4nt,项目名称:TorCMS,代码行数:6,代码来源:muser.py
注:本文中的torlite.model.core_tab.CabMember类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论