增加比赛相关的功能
This commit is contained in:
31
contest/migrations/0005_contestsubmission.py
Normal file
31
contest/migrations/0005_contestsubmission.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('contest', '0004_remove_contestproblem_difficulty'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ContestSubmission',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('total_submission_number', models.IntegerField(default=1)),
|
||||
('ac', models.BooleanField()),
|
||||
('total_time', models.IntegerField(default=0)),
|
||||
('contest', models.ForeignKey(to='contest.Contest')),
|
||||
('problem', models.ForeignKey(to='contest.ContestProblem')),
|
||||
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'db_table': 'contest_submission',
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -285,7 +285,8 @@ def contest_problems_list_page(request, contest_id):
|
||||
# 右侧的公告列表
|
||||
announcements = Announcement.objects.filter(is_global=True, visible=True).order_by("-create_time")
|
||||
return render(request, "oj/contest/contest_problems_list.html", {"contest_problems": contest_problems,
|
||||
"announcements": announcements})
|
||||
"announcements": announcements,
|
||||
"contest": {"id": contest_id}})
|
||||
|
||||
|
||||
def contest_list_page(request, page=1):
|
||||
|
||||
Reference in New Issue
Block a user