ec6a003df0478d10cf88a0899fddc3a9fe51b4a3
[koed-quiz.git] / apps / quiz / migrations / 0001_initial.py
1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
3
4 from django.db import models, migrations
5
6
7 class Migration(migrations.Migration):
8
9     dependencies = [
10         ('sites', '0001_initial'),
11     ]
12
13     operations = [
14         migrations.CreateModel(
15             name='Answer',
16             fields=[
17                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
18                 ('title', models.CharField(max_length=255)),
19                 ('ordering', models.SmallIntegerField()),
20             ],
21             options={
22                 'ordering': ['question', 'ordering'],
23                 'verbose_name': 'answer',
24                 'verbose_name_plural': 'answers',
25             },
26             bases=(models.Model,),
27         ),
28         migrations.CreateModel(
29             name='Question',
30             fields=[
31                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
32                 ('slug', models.SlugField()),
33                 ('ordering', models.SmallIntegerField()),
34                 ('title', models.CharField(max_length=255)),
35                 ('text', models.TextField(null=True, blank=True)),
36                 ('description', models.TextField(null=True, blank=True)),
37             ],
38             options={
39                 'ordering': ['quiz', 'ordering'],
40                 'verbose_name': 'question',
41                 'verbose_name_plural': 'questions',
42             },
43             bases=(models.Model,),
44         ),
45         migrations.CreateModel(
46             name='Quiz',
47             fields=[
48                 ('site_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='sites.Site')),
49                 ('description', models.TextField()),
50                 ('footer', models.TextField(null=True, blank=True)),
51             ],
52             options={
53                 'verbose_name': 'quiz',
54                 'verbose_name_plural': 'quizzes',
55             },
56             bases=('sites.site',),
57         ),
58         migrations.CreateModel(
59             name='Result',
60             fields=[
61                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
62                 ('slug', models.SlugField()),
63                 ('title', models.CharField(max_length=255)),
64                 ('text', models.TextField()),
65                 ('quiz', models.ForeignKey(to='quiz.Quiz')),
66             ],
67             options={
68                 'ordering': ['quiz', 'title'],
69                 'verbose_name': 'result',
70                 'verbose_name_plural': 'results',
71             },
72             bases=(models.Model,),
73         ),
74         migrations.AddField(
75             model_name='question',
76             name='quiz',
77             field=models.ForeignKey(to='quiz.Quiz'),
78             preserve_default=True,
79         ),
80         migrations.AlterUniqueTogether(
81             name='question',
82             unique_together=set([('quiz', 'slug'), ('quiz', 'ordering')]),
83         ),
84         migrations.AddField(
85             model_name='answer',
86             name='go_to',
87             field=models.ForeignKey(related_name='go_tos', blank=True, to='quiz.Question', null=True),
88             preserve_default=True,
89         ),
90         migrations.AddField(
91             model_name='answer',
92             name='question',
93             field=models.ForeignKey(to='quiz.Question'),
94             preserve_default=True,
95         ),
96         migrations.AddField(
97             model_name='answer',
98             name='result',
99             field=models.ForeignKey(blank=True, to='quiz.Result', null=True),
100             preserve_default=True,
101         ),
102     ]