code: def query_all(kind='1', by_count=False, by_order=True):
          '''
          Qeury all the categories, order by count or defined order.
          '''
          if by_count:
              recs = TabTag.select().where(TabTag.kind == kind).order_by(TabTag.count.desc())
          elif by_order:
              recs = TabTag.select().where(TabTag.kind == kind).order_by(TabTag.order)
          else:
              recs = TabTag.select().where(TabTag.kind == kind).order_by(TabTag.uid)
          return recf query_all(kind='1', by_count=False, by_order=True):
          '''
          Qeury all the categories, order by count or defined order.
          '''
          if by_count:
              recs = TabTag.select().where(TabTag.kind == kind).order_by(TabTag.count.desc())
          elif by_order:
              recs = TabTag.select().where(TabTag.kind == kind).order_by(TabTag.order)
          else:
              recs = TabTag.select().where(TabTag.kind == kind).order_by(TabTag.uid)
          return recs
docs: Qeury all the categories, order by count or defined order.