update to django 2.0

This commit is contained in:
virusdefender
2019-03-11 11:25:10 +08:00
parent f7bd9f16b4
commit 6b7654a0c3
18 changed files with 69 additions and 53 deletions

View File

@@ -22,8 +22,8 @@ class JudgeStatus:
class Submission(models.Model):
id = models.TextField(default=rand_str, primary_key=True, db_index=True)
contest = models.ForeignKey(Contest, null=True)
problem = models.ForeignKey(Problem)
contest = models.ForeignKey(Contest, null=True, on_delete=models.CASCADE)
problem = models.ForeignKey(Problem, on_delete=models.CASCADE)
create_time = models.DateTimeField(auto_now_add=True)
user_id = models.IntegerField(db_index=True)
username = models.TextField()