def api_messages_submissions_(request): form = request.web_input(count=0, backtime=0, nexttime=0) try: count = int(form.count) backtime = int(form.backtime) nexttime = int(form.nexttime) except ValueError: raise HTTPUnprocessableEntity(json=_ERROR_UNEXPECTED) else: count = min(count or 100, 100) submissions = message.select_submissions(request.userid, count + 1, include_tags=True, backtime=backtime, nexttime=nexttime) backtime, nexttime = d.paginate(submissions, backtime, nexttime, count, 'unixtime') ret = [] for sub in submissions: tidy_submission(sub) ret.append(sub) return { 'backtime': backtime, 'nexttime': nexttime, 'submissions': ret, }
def GET(self): form = web.input(count=0, backtime=0, nexttime=0) try: count = int(form.count) backtime = int(form.backtime) nexttime = int(form.nexttime) except ValueError: web.ctx.status = '422 Unprocessable Entity' return json.dumps(_ERROR_UNEXPECTED) else: count = min(count or 100, 100) submissions = message.select_submissions( self.user_id, count + 1, backtime=backtime, nexttime=nexttime) backtime, nexttime = d.paginate(submissions, backtime, nexttime, count, 'unixtime') ret = [] for sub in submissions: tidy_submission(sub) ret.append(sub) return json.dumps({ 'backtime': backtime, 'nexttime': nexttime, 'submissions': ret, })
def GET(self): form = web.input(feature="", backtime=None, nexttime=None) define._page_header_info.refresh(self.user_id) return define.webpage(self.user_id, "message/submissions_thumbnails.html", [ # Feature form.feature, # Submissions message.select_submissions(self.user_id, 66, backtime=define.get_int(form.backtime), nexttime=define.get_int(form.nexttime)), ])
def messages_submissions_(request): form = request.web_input(feature="", backtime=None, nexttime=None) define._page_header_info.refresh(request.userid) return Response(define.webpage(request.userid, "message/submissions_thumbnails.html", [ # Feature form.feature, # Submissions message.select_submissions(request.userid, 66, include_tags=False, backtime=define.get_int(form.backtime), nexttime=define.get_int(form.nexttime)), ]))
def GET(self): form = web.input(feature="", backtime=None, nexttime=None) define._page_header_info.refresh(self.user_id) return define.webpage( self.user_id, "message/submissions_thumbnails.html", [ # Feature form.feature, # Submissions message.select_submissions( self.user_id, 66, backtime=define.get_int(form.backtime), nexttime=define.get_int(form.nexttime)), ])
def messages_submissions_(request): form = request.web_input(feature="", backtime=None, nexttime=None) define._page_header_info.refresh(request.userid) return Response( define.webpage( request.userid, "message/submissions_thumbnails.html", [ # Feature form.feature, # Submissions message.select_submissions( request.userid, 66, include_tags=False, backtime=define.get_int(form.backtime), nexttime=define.get_int(form.nexttime)), ]))
def api_messages_submissions_(request): form = request.web_input(count=0, backtime=0, nexttime=0) try: count = int(form.count) backtime = int(form.backtime) nexttime = int(form.nexttime) except ValueError: raise HTTPUnprocessableEntity(json=_ERROR_UNEXPECTED) else: count = min(count or 100, 100) submissions = message.select_submissions( request.userid, count + 1, include_tags=True, backtime=backtime, nexttime=nexttime) backtime, nexttime = d.paginate(submissions, backtime, nexttime, count, 'unixtime') ret = [] for sub in submissions: tidy_submission(sub) ret.append(sub) return { 'backtime': backtime, 'nexttime': nexttime, 'submissions': ret, }