You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
888 B
42 lines
888 B
from __future__ import unicode_literals
|
|
|
|
from courses.models import Requirement, Question
|
|
|
|
from django.db import migrations
|
|
|
|
|
|
def init_demands(*_args, **_kwargs):
|
|
requirement, created = Requirement.objects.get_or_create(
|
|
min_balls=51,
|
|
name="Стандартные требования",
|
|
)
|
|
|
|
Question.objects.get_or_create(
|
|
requirement=requirement,
|
|
text='Комментарий',
|
|
type='text',
|
|
null=True,
|
|
balls=50,
|
|
)
|
|
|
|
Question.objects.get_or_create(
|
|
requirement=requirement,
|
|
text='Приложенные файлы',
|
|
type='files',
|
|
null=True,
|
|
multiple=True,
|
|
balls=50,
|
|
)
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('courses', '0001_initial'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(init_demands)
|
|
] |