Ejemplo n.º 1
0
 def query_all(limit=50):
     '''
     Return some of the records. Not all.
     :param limit:
     :return:
     '''
     return g_Member.select().limit(limit)
Ejemplo n.º 2
0
 def check_user(self, u_name, u_pass):
     tt = g_Member.select().where(g_Member.user_name == u_name).count()
     if tt == 0:
         return -1
     a = g_Member.get(user_name=u_name)
     if a.user_pass == tools.md5(u_pass):
         return 1
     return 0
Ejemplo n.º 3
0
 def check_user(user_id, u_pass):
     tt = g_Member.select().where(g_Member.uid == user_id).count()
     if tt == 0:
         return -1
     a = g_Member.get(uid=user_id)
     if a.user_pass == tools.md5(u_pass):
         return 1
     return 0
Ejemplo n.º 4
0
 def get_by_keyword(self, par2):
     return g_Member.select().where(g_Member.user_name.contains(par2))
Ejemplo n.º 5
0
 def query_nologin():
     time_now = tools.timestamp()
     # num * month * hours * minite * second
     return g_Member.select().where((
         (time_now - g_Member.time_login) > 3 * 30 * 24 * 60 * 60) & (
             (time_now - g_Member.time_email) > 4 * 30 * 24 * 60 * 60))