def index():
site_info = site_get()
article_id = request.args.get('article_id',0)
article_dict = []
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']
tempdict = {}
article_list = Article.query.filter_by(show = 1).all()
if article_list is not None:
for temp in article_list:
tempdict = temp.__dict__
article_dict.append([tempdict["id"],tempdict["title"],tempdict["timestamp"].strftime('%Y-%m-%d'),tempdict["body"][:150]])
return render_template('index.html', **locals())
评论列表
文章目录