site_tps/vote/migrations/0001_initial.py

39 lines
1.5 KiB
Python
Raw Normal View History

2018-01-22 13:25:19 +00:00
# Generated by Django 2.0.1 on 2018-01-22 13:24
2018-01-21 00:10:32 +00:00
2018-01-22 13:25:19 +00:00
from django.conf import settings
2018-01-21 00:10:32 +00:00
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
2018-01-22 13:25:19 +00:00
('auth', '0009_alter_user_last_name_max_length'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('content', '0001_initial'),
2018-01-21 00:10:32 +00:00
]
operations = [
migrations.CreateModel(
2018-01-22 13:25:19 +00:00
name='Poll',
2018-01-21 00:10:32 +00:00
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
2018-01-22 13:25:19 +00:00
('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')),
2018-01-21 00:10:32 +00:00
],
),
migrations.CreateModel(
2018-01-22 13:25:19 +00:00
name='Vote',
2018-01-21 00:10:32 +00:00
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
2018-01-22 13:25:19 +00:00
('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')),
('votant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
2018-01-21 00:10:32 +00:00
],
),
]