def manage_system_setting(req): end_time = admins.get_end_time() publicity_pictures = admins.get_publicity_pictures() bug_types = admins.get_bug_types() context = {"end_time": end_time.date(), "publicity_pictures": publicity_pictures, "bug_types": bug_types} return render_to_response("admins/system.html", context)
def manage_system_setting(req): end_time = admins.get_end_time() publicity_pictures = admins.get_publicity_pictures() bug_types = admins.get_bug_types() context = { "end_time": end_time.date(), "publicity_pictures": publicity_pictures, "bug_types": bug_types } return render_to_response("admins/system.html", context)
def index_view(req): context = {} last_days = (admins.get_end_time() - datetime.now()).days if last_days >= 0: context['last_days'] = last_days else: context['last_days'] = "已结束" ran_li, count = users.get_order_users("-bonus", end=6) context['rank_list'] = dict(map(lambda entry: (entry[0] + 1, entry[1]), enumerate(ran_li))) news_li, count = news.get_order_news("time", end=4) context['news_list'] = news_li pic_list = admins.get_publicity_pictures() context['pic_list'] = pic_list context['pic_index'] = range(len(pic_list)) name = req.session.get("name", '') if name: context['name'] = name return render_to_response("index.html", context)
def index_view(req): context = {} last_days = (admins.get_end_time() - datetime.now()).days if last_days >= 0: context['last_days'] = last_days else: context['last_days'] = "已结束" ran_li, count = users.get_order_users("-bonus", end=6) context['rank_list'] = dict( map(lambda entry: (entry[0] + 1, entry[1]), enumerate(ran_li))) news_li, count = news.get_order_news("time", end=4) context['news_list'] = news_li pic_list = admins.get_publicity_pictures() context['pic_list'] = pic_list context['pic_index'] = range(len(pic_list)) name = req.session.get("name", '') if name: context['name'] = name return render_to_response("index.html", context)