Django 2.0
[wolnelektury.git] / src / polls / migrations / 0001_initial.py
1 from django.db import models, migrations
2 import django.db.models.deletion
3
4
5 class Migration(migrations.Migration):
6
7     dependencies = [
8     ]
9
10     operations = [
11         migrations.CreateModel(
12             name='Poll',
13             fields=[
14                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
15                 ('question', models.TextField(verbose_name='question')),
16                 ('slug', models.SlugField(verbose_name='Slug')),
17                 ('open', models.BooleanField(default=False, verbose_name='open')),
18             ],
19             options={
20                 'verbose_name': 'Poll',
21                 'verbose_name_plural': 'Polls',
22             },
23             bases=(models.Model,),
24         ),
25         migrations.CreateModel(
26             name='PollItem',
27             fields=[
28                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
29                 ('content', models.TextField(verbose_name='content')),
30                 ('vote_count', models.IntegerField(default=0, verbose_name='vote count')),
31                 ('poll', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='polls.Poll')),
32             ],
33             options={
34                 'verbose_name': 'vote item',
35                 'verbose_name_plural': 'vote items',
36             },
37             bases=(models.Model,),
38         ),
39     ]