mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Election bdd + first view
This commit is contained in:
51
election/migrations/0001_initial.py
Normal file
51
election/migrations/0001_initial.py
Normal file
@ -0,0 +1,51 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('subscription', '0003_auto_20160902_1914'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Candidate',
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)),
|
||||
('votes', models.IntegerField(default=0, verbose_name='votes')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Election',
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)),
|
||||
('title', models.CharField(verbose_name='title', max_length=255)),
|
||||
('description', models.TextField(blank=True, null=True, verbose_name='description')),
|
||||
('start_date', models.DateTimeField(verbose_name='start date')),
|
||||
('end_date', models.DateTimeField(verbose_name='end date')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Responsability',
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)),
|
||||
('title', models.CharField(verbose_name='title', max_length=255)),
|
||||
('description', models.TextField(blank=True, null=True, verbose_name='description')),
|
||||
('blank_votes', models.IntegerField(default=0, verbose_name='blank votes')),
|
||||
('election', models.ForeignKey(to='election.Election', related_name='election', verbose_name='election')),
|
||||
],
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='candidate',
|
||||
name='responsability',
|
||||
field=models.ForeignKey(to='election.Responsability', related_name='responsability', verbose_name='responsability'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='candidate',
|
||||
name='subscriber',
|
||||
field=models.ForeignKey(related_name='candidate', to='subscription.Subscriber', blank=True, verbose_name='user'),
|
||||
),
|
||||
]
|
19
election/migrations/0002_candidate_program.py
Normal file
19
election/migrations/0002_candidate_program.py
Normal file
@ -0,0 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('election', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='candidate',
|
||||
name='program',
|
||||
field=models.TextField(verbose_name='description', null=True, blank=True),
|
||||
),
|
||||
]
|
0
election/migrations/__init__.py
Normal file
0
election/migrations/__init__.py
Normal file
Reference in New Issue
Block a user