def list_job(page=None): """""" page = int(request.args.get('page', 1)) if page == None or page <= 0: page = 1 jobs = api_job.get_lastest_page(page) pageInfo = paginationInfo(jobs) jobs = [dict(id=job.id, title=job.title, type=job.job_type, create_at=mkmillseconds(job.create_at)) for job in jobs.items] return jsonres(rv=dict(datas=jobs, pageInfo=pageInfo))
def index(html=None): """""" if current_app.debug and html is not None: if html=='favicon.ico': return send_from_directory(os.path.join(current_app.root_path, 'templates'), 'favicon.ico', mimetype='image/vnd.microsoft.icon') else: pos = html.find('.') if pos != -1 : return render_template('/%s' % html) else: abort(404) jobs = api_job.get_lastest_page(1, per_page=5) carinfos = api_carpool.get_lastest_page(1, per_page=5) #blogs = api_blog.get_lastest_page(1, per_page=5) # return render_template('index/index.html', jobs=jobs, carinfos=carinfos)#, blogs=blogs) return redirect(url_for('job.list_job'))