Exemple #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)
Exemple #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'],
     )
Exemple #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'],
     )
Exemple #4
0
 def __init__(self):
     self.tab = CabCatalog
     try:
         CabCatalog.create_table()
     except:
         pass
Exemple #5
0
 def __init__(self):
     self.tab = CabCatalog
     try:
         CabCatalog.create_table()
     except:
         pass
Exemple #6
0
 def update_post_catalog_num(self, cat_id, num):
     entry = CabCatalog.update(
         post_count = num,
     ).where(CabCatalog.uid == cat_id )
     entry.execute()
Exemple #7
0
 def get_by_id(self, idd):
     return CabCatalog.get(id_cat=idd)
Exemple #8
0
 def get_by_slug(self, slug):
     return CabCatalog.get(slug=slug)
Exemple #9
0
 def query_field_count(self, limit_num):
     recs = CabCatalog.select().order_by(CabCatalog.app_count.desc()).limit(limit_num)
     return (recs)
Exemple #10
0
 def update_post_catalog_num(self, cat_id, num):
     entry = CabCatalog.update(
         post_count=num, ).where(CabCatalog.uid == cat_id)
     entry.execute()
Exemple #11
0
 def get_by_id(self, idd):
     return CabCatalog.get(id_cat=idd)
Exemple #12
0
 def get_by_slug(self, slug):
     return CabCatalog.get(slug=slug)
Exemple #13
0
 def query_field_count(self, limit_num):
     recs = CabCatalog.select().order_by(
         CabCatalog.app_count.desc()).limit(limit_num)
     return (recs)
Exemple #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)