Commit 60f49352 authored by Arnaud Fabre's avatar Arnaud Fabre

fixes models

parent 093248c1
......@@ -14,9 +14,9 @@ class Migration(migrations.Migration):
name='Dossier',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('title', models.CharField(max_length=500)),
('title', models.CharField(max_length=1000)),
('reference', models.CharField(max_length=200)),
('text', models.TextField()),
('text', models.TextField(blank=True)),
('link', models.URLField()),
],
options={
......@@ -27,11 +27,15 @@ class Migration(migrations.Migration):
name='Proposal',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('title', models.CharField(max_length=500)),
('description', models.TextField()),
('reference', models.CharField(max_length=200)),
('title', models.CharField(max_length=1000)),
('description', models.TextField(blank=True)),
('reference', models.CharField(max_length=200, blank=True)),
('datetime', models.DateTimeField()),
('dossier', models.ForeignKey(to='representatives_votes.Dossier')),
('kind', models.CharField(max_length=200, blank=True)),
('total_abstain', models.IntegerField()),
('total_against', models.IntegerField()),
('total_for', models.IntegerField()),
('dossier', models.ForeignKey(related_name='proposals', to='representatives_votes.Dossier')),
],
options={
},
......@@ -41,10 +45,10 @@ class Migration(migrations.Migration):
name='Vote',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('representative_slug', models.CharField(max_length=200, null=True, blank=True)),
('representative_remote_id', models.CharField(max_length=200, null=True, blank=True)),
('representative_name', models.CharField(max_length=200, blank=True)),
('representative_remote_id', models.CharField(max_length=200, blank=True)),
('position', models.CharField(max_length=10, choices=[(b'abstain', b'abstain'), (b'for', b'for'), (b'against', b'against')])),
('proposal', models.ForeignKey(to='representatives_votes.Proposal')),
('proposal', models.ForeignKey(related_name='votes', to='representatives_votes.Proposal')),
],
options={
},
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('representatives_votes', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='proposal',
name='total_abstain',
field=models.IntegerField(default=0),
preserve_default=False,
),
migrations.AddField(
model_name='proposal',
name='total_against',
field=models.IntegerField(default=0),
preserve_default=False,
),
migrations.AddField(
model_name='proposal',
name='total_for',
field=models.IntegerField(default=0),
preserve_default=False,
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('representatives_votes', '0002_auto_20150511_1209'),
]
operations = [
migrations.AddField(
model_name='proposal',
name='kind',
field=models.CharField(max_length=200, null=True),
preserve_default=True,
),
migrations.AlterField(
model_name='proposal',
name='reference',
field=models.CharField(max_length=200, null=True),
preserve_default=True,
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('representatives_votes', '0003_auto_20150513_0936'),
]
operations = [
migrations.RenameField(
model_name='vote',
old_name='representative_slug',
new_name='representative_name',
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('representatives_votes', '0004_auto_20150513_1216'),
]
operations = [
migrations.AlterField(
model_name='dossier',
name='title',
field=models.CharField(max_length=1000),
preserve_default=True,
),
migrations.AlterField(
model_name='proposal',
name='title',
field=models.CharField(max_length=1000),
preserve_default=True,
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('representatives_votes', '0005_auto_20150521_1529'),
]
operations = [
migrations.AlterField(
model_name='dossier',
name='text',
field=models.TextField(null=True, blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='proposal',
name='description',
field=models.TextField(null=True, blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='proposal',
name='dossier',
field=models.ForeignKey(related_name='proposals', to='representatives_votes.Dossier'),
preserve_default=True,
),
migrations.AlterField(
model_name='vote',
name='proposal',
field=models.ForeignKey(related_name='votes', to='representatives_votes.Proposal'),
preserve_default=True,
),
]
......@@ -22,17 +22,17 @@ from django.db import models
class Dossier(models.Model):
title = models.CharField(max_length=1000)
reference = models.CharField(max_length=200)
text = models.TextField(blank=True, null=True)
text = models.TextField(blank=True)
link = models.URLField()
class Proposal(models.Model):
dossier = models.ForeignKey(Dossier, related_name='proposals')
title = models.CharField(max_length=1000)
description = models.TextField(blank=True, null=True)
reference = models.CharField(max_length=200, null=True)
description = models.TextField(blank=True)
reference = models.CharField(max_length=200, blank=True)
datetime = models.DateTimeField()
kind = models.CharField(max_length=200, null=True)
kind = models.CharField(max_length=200, blank=True)
total_abstain = models.IntegerField()
total_against = models.IntegerField()
total_for = models.IntegerField()
......@@ -56,7 +56,7 @@ class Vote(models.Model):
proposal = models.ForeignKey(Proposal, related_name='votes')
# There are two representative fields for flexibility,
representative_name = models.CharField(max_length=200, blank=True, null=True)
representative_remote_id = models.CharField(max_length=200, blank=True, null=True)
representative_name = models.CharField(max_length=200, blank=True)
representative_remote_id = models.CharField(max_length=200, blank=True)
position = models.CharField(max_length=10, choices=VOTECHOICES)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment