mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-12-29 16:41:56 +00:00
增加几个 model
This commit is contained in:
parent
3ee4b57802
commit
c6d6b13072
@ -15,7 +15,10 @@ class UserManager(models.Manager):
|
||||
|
||||
|
||||
class User(AbstractBaseUser):
|
||||
# 用户名
|
||||
username = models.CharField(max_length=30, unique=True)
|
||||
# 真实姓名
|
||||
real_name = models.CharField(max_length=30, blank=True, null=True)
|
||||
admin_group = models.ForeignKey(AdminGroup, null=True, on_delete=models.SET_NULL)
|
||||
|
||||
USERNAME_FIELD = 'username'
|
||||
|
@ -1,11 +1,18 @@
|
||||
# coding=utf-8
|
||||
from django.db import models
|
||||
|
||||
from account.models import User
|
||||
from problem.models import AbstractProblem
|
||||
|
||||
|
||||
class Contest(models.Model):
|
||||
pass
|
||||
title = models.CharField(max_length=40)
|
||||
description = models.TextField()
|
||||
is_public = models.BooleanField()
|
||||
password = models.CharField(max_length=30, blank=True, null=True)
|
||||
start_time = models.DateTimeField()
|
||||
end_time = models.DateTimeField()
|
||||
created_by = models.ForeignKey(User)
|
||||
|
||||
|
||||
class ContestProblem(AbstractProblem):
|
||||
|
@ -26,7 +26,7 @@ class AbstractProblem(models.Model):
|
||||
# 最后更新时间
|
||||
last_update_time = models.DateTimeField(auto_now=True)
|
||||
# 这个题是谁创建的
|
||||
author = models.ForeignKey(User)
|
||||
created_by = models.ForeignKey(User)
|
||||
# 来源
|
||||
source = models.CharField(max_length=30, blank=True)
|
||||
# 时间限制 单位是毫秒
|
||||
|
Loading…
Reference in New Issue
Block a user