Skip to content

Commit

Permalink
Merge pull request #147 from LQDJudge/anhkha2003
Browse files Browse the repository at this point in the history
Add index problem for model submission
  • Loading branch information
anhkha2003 authored Jan 14, 2025
2 parents 87e8486 + cd8d115 commit 5fe5d02
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions judge/migrations/0201_add_index_submission_problem.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.2.17 on 2025-01-14 00:33

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("judge", "0200_recalculate_submission_time"),
]

operations = [
migrations.AddIndex(
model_name="submission",
index=models.Index(
fields=["problem", "result", "points"],
name="judge_submi_problem_23235d_idx",
),
),
]
1 change: 1 addition & 0 deletions judge/models/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ class Meta:
models.Index(fields=["problem", "user", "-points"]),
models.Index(fields=["contest_object", "problem", "user", "-points"]),
models.Index(fields=["language", "result"]),
models.Index(fields=["problem", "result", "points"]),
]


Expand Down
2 changes: 1 addition & 1 deletion templates/submission/row.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
{% else %}
{% if "TLE" != submission.result %}
<div title="{{ submission.time or 0 }}s" class="time">
{{ (submission.time or 0)|floatformat(2) }}s
{{ (submission.time * 1000 or 0)|floatformat(0) }} ms
</div>
{% else %}
<div class="time">---</div>
Expand Down

0 comments on commit 5fe5d02

Please sign in to comment.