后台可以筛选管理员
This commit is contained in:
18
problem/migrations/0016_alter_problem_last_update_time.py
Normal file
18
problem/migrations/0016_alter_problem_last_update_time.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.0.6 on 2025-04-30 01:40
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('problem', '0015_alter_problem_io_mode_alter_problem_languages_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='problem',
|
||||
name='last_update_time',
|
||||
field=models.DateTimeField(auto_now=True),
|
||||
),
|
||||
]
|
||||
@@ -1,3 +1,4 @@
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from utils.models import JSONField
|
||||
|
||||
@@ -59,7 +60,7 @@ class Problem(models.Model):
|
||||
template = JSONField()
|
||||
create_time = models.DateTimeField(auto_now_add=True)
|
||||
# we can not use auto_now here
|
||||
last_update_time = models.DateTimeField(null=True)
|
||||
last_update_time = models.DateTimeField(auto_now=True)
|
||||
created_by = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
# ms
|
||||
time_limit = models.IntegerField()
|
||||
@@ -82,7 +83,7 @@ class Problem(models.Model):
|
||||
total_score = models.IntegerField(default=0)
|
||||
submission_number = models.BigIntegerField(default=0)
|
||||
accepted_number = models.BigIntegerField(default=0)
|
||||
# {JudgeStatus.ACCEPTED: 3, JudgeStaus.WRONG_ANSWER: 11}, the number means count
|
||||
# {JudgeStatus.ACCEPTED: 3, JudgeStatus.WRONG_ANSWER: 11}, the number means count
|
||||
statistic_info = JSONField(default=dict)
|
||||
share_submission = models.BooleanField(default=False)
|
||||
|
||||
@@ -98,3 +99,13 @@ class Problem(models.Model):
|
||||
def add_ac_number(self):
|
||||
self.accepted_number = models.F("accepted_number") + 1
|
||||
self.save(update_fields=["accepted_number"])
|
||||
|
||||
|
||||
# class ProblemSet(models):
|
||||
# title = models.CharField(max_length=20)
|
||||
# subtitle = models.CharField(max_length=50)
|
||||
# problems = models.ManyToManyField(Problem)
|
||||
# badge = models.FilePathField(path=settings.UPLOAD_DIR)
|
||||
# overviews = models.JSONField()
|
||||
# create_time = models.DateTimeField(auto_now_add=True)
|
||||
# update_time = models.DateTimeField(auto_now=True)
|
||||
|
||||
Reference in New Issue
Block a user