添加比赛排名的封榜功能,rank页面从redis中读取排名信息而不是向mysql查询,封榜后redis中的数据便不再更新了

This commit is contained in:
sxw@401
2015-09-12 22:00:24 +08:00
parent a084614af9
commit 444cbc4324
4 changed files with 42 additions and 18 deletions

View File

@@ -20,6 +20,13 @@
</div>
<div class="row">
<div class="col-lg-12">
<h2 class="text-center">排名(
{% if real_time_rank %}
实时
{% else %}
已封榜
{% endif %})
</h2>
{% if result %}
<table class="table table-bordered">
<thead>

View File

@@ -67,7 +67,8 @@
<tbody>
{% for item in submissions %}
<tr>
{% ifequal item.user_id request.user.id %}
{% if item.user_id == request.user.id and request.user.admin_type == 2%}
<th scope="row"><a href="/submission/{{ item.id }}/">
{{ forloop.counter |add:start_id }}</a></th>
{% else %}