39 lines
1.6 KiB
Python
39 lines
1.6 KiB
Python
# Generated by Django 2.0.1 on 2018-01-24 10:29
|
|
|
|
from django.conf import settings
|
|
import django.core.validators
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('auth', '0009_alter_user_last_name_max_length'),
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
('content', '0001_initial'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Poll',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('title', models.CharField(max_length=1024)),
|
|
('contents', models.ManyToManyField(to='content.Content')),
|
|
('voters_group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='auth.Group')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Vote',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('vote', models.IntegerField(validators=[django.core.validators.MaxValueValidator(5), django.core.validators.MinValueValidator(0)])),
|
|
('content', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='content.Content')),
|
|
('poll', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vote.Poll')),
|
|
('votant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
),
|
|
]
|