Ejemplo n.º 1
0
 def query_all(self, with_count = False, by_order = False):
     if with_count == True:
         recs = CabCatalog.select().order_by(CabCatalog.post_count.desc())
     elif by_order == True:
         recs = CabCatalog.select().order_by(CabCatalog.order)
     else:
         recs = CabCatalog.select().order_by(CabCatalog.name)
     return (recs)
Ejemplo n.º 2
0
 def initial_db(self, post_data):
     '''
     '''
     entry = CabCatalog.create(
         name=post_data['name'],
         id_cat=post_data['id_cat'],
         slug=post_data['slug'],
         order=post_data['order'],
     )
Ejemplo n.º 3
0
 def initial_db(self, post_data):
     '''
     '''
     entry = CabCatalog.create(
         name=post_data['name'],
         id_cat=post_data['id_cat'],
         slug=post_data['slug'],
         order=post_data['order'],
     )
Ejemplo n.º 4
0
 def __init__(self):
     self.tab = CabCatalog
     try:
         CabCatalog.create_table()
     except:
         pass
Ejemplo n.º 5
0
 def __init__(self):
     self.tab = CabCatalog
     try:
         CabCatalog.create_table()
     except:
         pass
Ejemplo n.º 6
0
 def update_post_catalog_num(self, cat_id, num):
     entry = CabCatalog.update(
         post_count = num,
     ).where(CabCatalog.uid == cat_id )
     entry.execute()
Ejemplo n.º 7
0
 def get_by_id(self, idd):
     return CabCatalog.get(id_cat=idd)
Ejemplo n.º 8
0
 def get_by_slug(self, slug):
     return CabCatalog.get(slug=slug)
Ejemplo n.º 9
0
 def query_field_count(self, limit_num):
     recs = CabCatalog.select().order_by(CabCatalog.app_count.desc()).limit(limit_num)
     return (recs)
Ejemplo n.º 10
0
 def update_post_catalog_num(self, cat_id, num):
     entry = CabCatalog.update(
         post_count=num, ).where(CabCatalog.uid == cat_id)
     entry.execute()
Ejemplo n.º 11
0
 def get_by_id(self, idd):
     return CabCatalog.get(id_cat=idd)
Ejemplo n.º 12
0
 def get_by_slug(self, slug):
     return CabCatalog.get(slug=slug)
Ejemplo n.º 13
0
 def query_field_count(self, limit_num):
     recs = CabCatalog.select().order_by(
         CabCatalog.app_count.desc()).limit(limit_num)
     return (recs)
Ejemplo n.º 14
0
 def query_all(self, with_count=False):
     if with_count == True:
         recs = CabCatalog.select().order_by(CabCatalog.post_count.desc())
     else:
         recs = CabCatalog.select().order_by(CabCatalog.name)
     return (recs)