Esempio 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)
Esempio 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'],
     )
Esempio 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'],
     )
Esempio n. 4
0
 def __init__(self):
     self.tab = CabCatalog
     try:
         CabCatalog.create_table()
     except:
         pass
Esempio n. 5
0
 def __init__(self):
     self.tab = CabCatalog
     try:
         CabCatalog.create_table()
     except:
         pass
Esempio 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()
Esempio n. 7
0
 def get_by_id(self, idd):
     return CabCatalog.get(id_cat=idd)
Esempio n. 8
0
 def get_by_slug(self, slug):
     return CabCatalog.get(slug=slug)
Esempio n. 9
0
 def query_field_count(self, limit_num):
     recs = CabCatalog.select().order_by(CabCatalog.app_count.desc()).limit(limit_num)
     return (recs)
Esempio 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()
Esempio n. 11
0
 def get_by_id(self, idd):
     return CabCatalog.get(id_cat=idd)
Esempio n. 12
0
 def get_by_slug(self, slug):
     return CabCatalog.get(slug=slug)
Esempio n. 13
0
 def query_field_count(self, limit_num):
     recs = CabCatalog.select().order_by(
         CabCatalog.app_count.desc()).limit(limit_num)
     return (recs)
Esempio 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)