Cloned DMOJ
This commit is contained in:
parent
f623974b58
commit
49dc9ff10c
513 changed files with 132349 additions and 39 deletions
17
judge/management/commands/addjudge.py
Normal file
17
judge/management/commands/addjudge.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
from django.core.management.base import BaseCommand
|
||||
|
||||
from judge.models import Judge
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'create a judge'
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument('name', help='the name of the judge')
|
||||
parser.add_argument('auth_key', help='authentication key for the judge')
|
||||
|
||||
def handle(self, *args, **options):
|
||||
judge = Judge()
|
||||
judge.name = options['name']
|
||||
judge.auth_key = options['auth_key']
|
||||
judge.save()
|
Loading…
Add table
Add a link
Reference in a new issue