code: def query_most(num=8, kind='1'):
          '''
          Query most viewed.
          '''
          return TabPost.select().where(
              (TabPost.kind == kind) &
              (TabPost.valid == 1)
          ).order_by(
              TabPost.view_count.desc()
          ).limit(numf query_most(num=8, kind='1'):
          '''
          Query most viewed.
          '''
          return TabPost.select().where(
              (TabPost.kind == kind) &
              (TabPost.valid == 1)
          ).order_by(
              TabPost.view_count.desc()
          ).limit(num)
docs: Query most viewed.