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


Python CabMember.create方法代碼示例

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


在下文中一共展示了CabMember.create方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: insert_data

# 需要導入模塊: from torlite.model.core_tab import CabMember [as 別名]
# 或者: from torlite.model.core_tab.CabMember import create [as 別名]
    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,代碼行數:36,代碼來源:muser.py

示例2: insert_data

# 需要導入模塊: from torlite.model.core_tab import CabMember [as 別名]
# 或者: from torlite.model.core_tab.CabMember import create [as 別名]
 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,代碼行數:13,代碼來源:muser.py

示例3: insert_data

# 需要導入模塊: from torlite.model.core_tab import CabMember [as 別名]
# 或者: from torlite.model.core_tab.CabMember import create [as 別名]
 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,代碼行數:12,代碼來源:muser.py

示例4: insert_data

# 需要導入模塊: from torlite.model.core_tab import CabMember [as 別名]
# 或者: from torlite.model.core_tab.CabMember import create [as 別名]
    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,代碼行數:14,代碼來源:muser.py

示例5: insert_data

# 需要導入模塊: from torlite.model.core_tab import CabMember [as 別名]
# 或者: from torlite.model.core_tab.CabMember import create [as 別名]
    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,代碼行數:20,代碼來源:muser.py


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