예제 #1
0
파일: mcatalog.py 프로젝트: Geoion/TorCMS
 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)
예제 #2
0
파일: mcatalog.py 프로젝트: Geoion/TorCMS
 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'],
     )
예제 #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'],
     )
예제 #4
0
파일: mcatalog.py 프로젝트: daimon99/TorCMS
 def __init__(self):
     self.tab = CabCatalog
     try:
         CabCatalog.create_table()
     except:
         pass
예제 #5
0
 def __init__(self):
     self.tab = CabCatalog
     try:
         CabCatalog.create_table()
     except:
         pass
예제 #6
0
파일: mcatalog.py 프로젝트: Geoion/TorCMS
 def update_post_catalog_num(self, cat_id, num):
     entry = CabCatalog.update(
         post_count = num,
     ).where(CabCatalog.uid == cat_id )
     entry.execute()
예제 #7
0
파일: mcatalog.py 프로젝트: Geoion/TorCMS
 def get_by_id(self, idd):
     return CabCatalog.get(id_cat=idd)
예제 #8
0
파일: mcatalog.py 프로젝트: Geoion/TorCMS
 def get_by_slug(self, slug):
     return CabCatalog.get(slug=slug)
예제 #9
0
파일: mcatalog.py 프로젝트: Geoion/TorCMS
 def query_field_count(self, limit_num):
     recs = CabCatalog.select().order_by(CabCatalog.app_count.desc()).limit(limit_num)
     return (recs)
예제 #10
0
 def update_post_catalog_num(self, cat_id, num):
     entry = CabCatalog.update(
         post_count=num, ).where(CabCatalog.uid == cat_id)
     entry.execute()
예제 #11
0
 def get_by_id(self, idd):
     return CabCatalog.get(id_cat=idd)
예제 #12
0
 def get_by_slug(self, slug):
     return CabCatalog.get(slug=slug)
예제 #13
0
 def query_field_count(self, limit_num):
     recs = CabCatalog.select().order_by(
         CabCatalog.app_count.desc()).limit(limit_num)
     return (recs)
예제 #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)