40 lines
1.8 KiB
Python
40 lines
1.8 KiB
Python
# Generated by Django 6.0.7 on 2026-07-19 16:08
|
|
|
|
import django.db.models.deletion
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('exams', '0009_examset_exact_html'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='QuestionGroup',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('key', models.SlugField(help_text='Short identifier used by Excel, for example notes_1.', max_length=60)),
|
|
('order', models.PositiveIntegerField(default=1)),
|
|
('layout_type', models.CharField(choices=[('notes', 'Notes / summary'), ('table', 'Table / form'), ('flow', 'Flow chart')], default='notes', max_length=20)),
|
|
('title', models.CharField(blank=True, max_length=200)),
|
|
('instructions', models.TextField(blank=True)),
|
|
('layout_html', models.TextField(help_text='Formatted worksheet HTML. Insert blanks with [[question number]], for example [[1]].')),
|
|
('section', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='question_groups', to='exams.section')),
|
|
],
|
|
options={
|
|
'ordering': ['order', 'id'],
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name='question',
|
|
name='group',
|
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='questions', to='exams.questiongroup'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='questiongroup',
|
|
constraint=models.UniqueConstraint(fields=('section', 'key'), name='unique_question_group_key_per_section'),
|
|
),
|
|
]
|