0001_initial.py 2.88 KB
Newer Older
Sli's avatar
Sli committed
1 2 3 4
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models
Sli's avatar
Sli committed
5
from django.conf import settings
Sli's avatar
Sli committed
6 7 8 9 10


class Migration(migrations.Migration):

    dependencies = [
Sli's avatar
Sli committed
11
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
Sli's avatar
Sli committed
12 13 14 15 16 17
    ]

    operations = [
        migrations.CreateModel(
            name='Candidate',
            fields=[
Sli's avatar
Sli committed
18 19
                ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
                ('program', models.TextField(blank=True, null=True, verbose_name='description')),
Sli's avatar
Sli committed
20 21 22 23 24
            ],
        ),
        migrations.CreateModel(
            name='Election',
            fields=[
Sli's avatar
Sli committed
25 26
                ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
                ('title', models.CharField(max_length=255, verbose_name='title')),
Sli's avatar
Sli committed
27
                ('description', models.TextField(blank=True, null=True, verbose_name='description')),
Sli's avatar
Sli committed
28 29
                ('start_proposal', models.DateTimeField(verbose_name='start proposal')),
                ('end_proposal', models.DateTimeField(verbose_name='end proposal')),
Sli's avatar
Sli committed
30 31 32 33 34 35 36
                ('start_date', models.DateTimeField(verbose_name='start date')),
                ('end_date', models.DateTimeField(verbose_name='end date')),
            ],
        ),
        migrations.CreateModel(
            name='Responsability',
            fields=[
Sli's avatar
Sli committed
37 38
                ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
                ('title', models.CharField(max_length=255, verbose_name='title')),
Sli's avatar
Sli committed
39
                ('description', models.TextField(blank=True, null=True, verbose_name='description')),
Sli's avatar
Sli committed
40 41 42 43 44 45 46 47 48 49
                ('election', models.ForeignKey(to='election.Election', verbose_name='election', related_name='responsability')),
            ],
        ),
        migrations.CreateModel(
            name='Vote',
            fields=[
                ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
                ('candidate', models.ManyToManyField(to='election.Candidate', related_name='vote', verbose_name='candidate')),
                ('election', models.ForeignKey(to='election.Election', verbose_name='election', related_name='vote')),
                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='user', related_name='vote')),
Sli's avatar
Sli committed
50 51 52 53 54
            ],
        ),
        migrations.AddField(
            model_name='candidate',
            name='responsability',
Sli's avatar
Sli committed
55
            field=models.ForeignKey(to='election.Responsability', verbose_name='responsability', related_name='candidate'),
Sli's avatar
Sli committed
56 57 58
        ),
        migrations.AddField(
            model_name='candidate',
Sli's avatar
Sli committed
59 60
            name='user',
            field=models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, verbose_name='user', related_name='candidate'),
Sli's avatar
Sli committed
61 62
        ),
    ]