Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
 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
Exemplo n.º 5
0
    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
Exemplo n.º 6
0
    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
Exemplo n.º 7
0
 def get_by_keyword(self, par2):
     return CabMember.select().where(CabMember.user_name.contains(par2))
Exemplo n.º 8
0
 def get_by_keyword(self, par2):
     return CabMember.select().where(CabMember.user_name.contains(par2))