Sith/election/migrations/0001_initial.py

76 lines
3.5 KiB
Python
Raw Normal View History

2016-12-05 19:18:03 +00:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
2016-12-07 22:55:05 +00:00
from django.conf import settings
2016-12-05 19:18:03 +00:00
class Migration(migrations.Migration):
dependencies = [
2016-12-07 22:55:05 +00:00
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
2016-12-05 19:18:03 +00:00
]
operations = [
migrations.CreateModel(
2016-12-13 21:22:19 +00:00
name='Candidature',
2016-12-05 19:18:03 +00:00
fields=[
2016-12-19 15:45:38 +00:00
('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)),
('program', models.TextField(blank=True, null=True, verbose_name='description')),
2016-12-05 19:18:03 +00:00
],
),
migrations.CreateModel(
name='Election',
fields=[
2016-12-19 15:45:38 +00:00
('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)),
('title', models.CharField(verbose_name='title', max_length=255)),
('description', models.TextField(blank=True, null=True, verbose_name='description')),
2016-12-13 21:22:19 +00:00
('start_candidature', models.DateTimeField(verbose_name='start candidature')),
('end_candidature', models.DateTimeField(verbose_name='end candidature')),
2016-12-05 19:18:03 +00:00
('start_date', models.DateTimeField(verbose_name='start date')),
('end_date', models.DateTimeField(verbose_name='end date')),
],
),
migrations.CreateModel(
2016-12-19 15:45:38 +00:00
name='ElectionList',
2016-12-13 21:22:19 +00:00
fields=[
2016-12-19 15:45:38 +00:00
('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)),
('title', models.CharField(verbose_name='title', max_length=255)),
('election', models.ForeignKey(related_name='election_list', verbose_name='election', to='election.Election')),
2016-12-13 21:22:19 +00:00
],
),
migrations.CreateModel(
name='Role',
2016-12-05 19:18:03 +00:00
fields=[
2016-12-19 15:45:38 +00:00
('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)),
('title', models.CharField(verbose_name='title', max_length=255)),
('description', models.TextField(blank=True, null=True, verbose_name='description')),
('election', models.ForeignKey(related_name='role', verbose_name='election', to='election.Election')),
('has_voted', models.ManyToManyField(related_name='has_voted', to=settings.AUTH_USER_MODEL, verbose_name='has voted')),
2016-12-07 22:55:05 +00:00
],
),
migrations.CreateModel(
name='Vote',
fields=[
2016-12-19 15:45:38 +00:00
('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)),
('candidature', models.ManyToManyField(related_name='vote', to='election.Candidature', verbose_name='candidature')),
('role', models.ForeignKey(related_name='vote', verbose_name='role', to='election.Role')),
2016-12-05 19:18:03 +00:00
],
),
2016-12-14 17:10:15 +00:00
migrations.AddField(
model_name='candidature',
2016-12-19 15:45:38 +00:00
name='election_list',
field=models.ForeignKey(related_name='candidature', verbose_name='election_list', to='election.ElectionList'),
2016-12-14 17:10:15 +00:00
),
2016-12-05 19:18:03 +00:00
migrations.AddField(
2016-12-13 21:22:19 +00:00
model_name='candidature',
name='role',
2016-12-19 15:45:38 +00:00
field=models.ForeignKey(related_name='candidature', verbose_name='role', to='election.Role'),
2016-12-05 19:18:03 +00:00
),
migrations.AddField(
2016-12-13 21:22:19 +00:00
model_name='candidature',
2016-12-07 22:55:05 +00:00
name='user',
2016-12-19 15:45:38 +00:00
field=models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='candidate', blank=True, verbose_name='user'),
2016-12-05 19:18:03 +00:00
),
]