标签:call erp als lang 页面 lse try java 操作
try:
page = int(request.args.get(‘p’,1))
except:
page=1
page_count = 10
userpag = User.query.paginate(page,page_count,False)
userlist = userpag.items #一共多少条
total_page = userpag.pages #当前有多少页
current_page = userpag.page #当前多少页
<link rel="stylesheet" href="/static/sadmin/css/jquery.pagination.css">
<script type="text/javascript" src="/static/sadmin/js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="/static/sadmin/js/jquery.pagination.min.js"></script>
$("#pagination").pagination({
currentPage: {{current_page}},
totalPage: {{total_page}},
callback: function(current) {
var keyword = $(".input_txt").val()
window.location.href="/sadmin/goodslist/?p="+current+"&keyword="+keyword
}
});
@web_blue.route(‘/fenye‘)
def hellw():
PER_PAGE = 10
total = Fen.query.count()
print(total)
page = request.args.get(get_page_parameter(),type=int,default=1)
start = (page-1)*PER_PAGE
end = start + PER_PAGE
pagination = Pagination(bs_version=3,page=page,total=total)
articles = Fen.query.slice(start,end)
context = {
‘pagination‘:pagination,
‘articles‘:articles
}
return render_template(‘index.html‘,**context)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
{% for a in articles %}
<ul>
<li>{{ a.name }}</li>
</ul>
{% endfor %}
{{ pagination.links }}
展详
@web_blue.route(‘/webgood‘,methods=[‘post‘,‘get‘])
def webgood():
try:
id = int(request.args.get(‘id‘))
except:
id = 0
good = ‘‘
if id >0:
good = Good.query.filter(Good.id == id).first()
cate = Cate.query.all()
return render_template("web/webgood.html",cate=cate,good=good)
展首展首
标签:call erp als lang 页面 lse try java 操作
原文地址:https://www.cnblogs.com/zuichuyouren/p/11094670.html