def edit():
site_info = site_get()
article_id = request.args.get('article_id',0)
temp_dict = {}
packet_dict = {}
packet_list = Packet.query.filter_by().all()
if packet_list is not None:
for temp in packet_list:
temp_dict = temp.__dict__
del temp_dict["_sa_instance_state"]
packet_dict[str(temp_dict['id'])] = temp_dict['packet_name']
#packet_dict = dict( packet_dict.items() + tempdict.items() )
if article_id != 0:
article = Article.query.filter_by(id = article_id).first()
#print article
if article is not None:
article = article.__dict__
title = article['title']
packet_id = article['packet_id']
show = article['show']
body = article['body']
return render_template('admin/edit.html', **locals())
评论列表
文章目录