def GET(self, categoryid=0, pageidx=1, pagesize=8): if categoryid is None: categoryid = 0 if pageidx is None: pageidx = 1 else: pageidx = int(pageidx) if pagesize is None: pagesize = 40 else: pagesize = int(pagesize) if pagesize > 100: pagesize = 40 categorys = json.loads(appblog.category().GET()) count = json.loads(appblog.count().GET(categoryid))['count'] pagecount = count / pagesize + 1 if count % pagesize == 0: pagecount = pagecount - 1 if pagecount < pageidx: pageidx = 1 blogs = json.loads(appblog.bloglist().GET(categoryid, pageidx, pagesize)) #mylog.loginfo(appblog.bloglist().GET(categoryid,pageidx,pagesize)) return render.blogview( config=config, menuname='/blog', login=islogin(), mgrprivilege=mgrprivilege(), blogid=None, categoryid=categoryid, categorys=categorys, blogs=blogs, pagecount=pagecount, pageidx=pageidx, pagesize=pagesize)
def GET(self, cururl): categorys = json.loads(appblog.category().GET()) blogs = json.loads(appblog.bloglist().GET(0, 1, 40)) return render.index(menuname = '/', login=islogin(), mgrprivilege=mgrprivilege(), photocount=8, categorys=categorys, blogs=blogs)