Example #1
0
 def query_all(current_page_num=1):
     '''
     查询所有未登录用户的访问记录
     '''
     return TabLog.select().where(TabLog.user_id == 'None').order_by(TabLog.time_out.desc()).paginate(
         current_page_num, CMS_CFG['list_num']
     )
Example #2
0
 def query_pager_by_user(userid, current_page_num=1):
     '''
     Query pager
     '''
     return TabLog.select().where(TabLog.user_id == userid).order_by(
         TabLog.time_create.desc()).paginate(current_page_num,
                                             CMS_CFG['list_num'])
Example #3
0
 def query_all_pageview(current_page_num=1):
     '''
     查询所有页面(current_url),分页
     '''
     return TabLog.select().distinct(TabLog.current_url).order_by(TabLog.current_url).paginate(
         current_page_num, CMS_CFG['list_num']
     )
Example #4
0
 def query_all_user():
     '''
     查询所有登录用户的访问记录
     '''
     return TabLog.select().where(TabLog.user_id != 'None').distinct(TabLog.user_id).order_by(
         TabLog.user_id
     )
Example #5
0
 def get_retention_time_by_id(uid, user_id):
     current_rec = MLog.get_by_uid(uid)
     recs = TabLog.select().where((TabLog.user_id == user_id) & (
         TabLog.time_create > current_rec.time_create)).order_by(
             TabLog.time_create)
     if recs.count():
         return recs.get()
     return None
Example #6
0
    def count_of_certain(user_id):
        recs = TabLog.select().where(TabLog.user_id == user_id)

        return recs.count()
Example #7
0
 def total_number():
     '''
     Return the number of certian slug.
     '''
     return TabLog.select().count()
Example #8
0
 def query_all_user(current_page_num=1):
     '''
     Query pager
     '''
     return TabLog.select().distinct(TabLog.user_id).order_by(
         TabLog.user_id).paginate(current_page_num, CMS_CFG['list_num'])
Example #9
0
 def total_number():
     '''
     Return the number of Tablog.
     '''
     return TabLog.select().count()
Example #10
0
 def count_of_current_url(current_url):
     '''
     长询制订页面(current_url)的访问量
     '''
     res = TabLog.select().where(TabLog.current_url == current_url)
     return res.count()
Example #11
0
 def query_all_current_url():
     '''
     查询所有页面(current_url)
     '''
     return TabLog.select().distinct(TabLog.current_url).order_by(TabLog.current_url)
Example #12
0
    def get_pageview_count(current_url):
        recs = TabLog.select().where(TabLog.current_url == current_url)

        return recs.count()
Example #13
0
    def count_of_certain_pageview():
        recs = TabLog.select().distinct(TabLog.current_url).order_by(TabLog.current_url)

        return recs.count()
Example #14
0
 def total_number():
     '''
     Return the number of Tablog.
     '''
     # adding ``None`` to hide ``No value for argument 'database' in method call``
     return TabLog.select().count(None)
Example #15
0
    def get_all(num=200):
        '''
        查询近期访问记录

        '''
        return TabLog.select().order_by(TabLog.time_create.desc()).limit(num)