當前位置: 首頁>>代碼示例>>Python>>正文


Python core_tab.CabMember類代碼示例

本文整理匯總了Python中torlite.model.core_tab.CabMember的典型用法代碼示例。如果您正苦於以下問題:Python CabMember類的具體用法?Python CabMember怎麽用?Python CabMember使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CabMember類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的torlite.model.core_tab.CabMember類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。