0001_initial.py 2.01 KB
Newer Older
1 2 3 4
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models
5
import autoslug.fields
6 7 8 9 10


class Migration(migrations.Migration):

    dependencies = [
Nicolas Joyard's avatar
Nicolas Joyard committed
11 12
        ('representatives_votes', '0001_initial'),
        ('representatives_positions', '0001_initial'),
13 14 15
    ]

    operations = [
Nicolas Joyard's avatar
Nicolas Joyard committed
16 17 18 19 20 21 22 23 24 25 26 27
        migrations.CreateModel(
            name='ThemeScore',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('score', models.FloatField(default=0)),
            ],
            options={
                'ordering': ['theme__slug'],
                'db_table': 'memopol_themes_themescore',
                'managed': False,
            },
        ),
28 29 30 31 32
        migrations.CreateModel(
            name='Theme',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(unique=True, max_length=255)),
33
                ('slug', autoslug.fields.AutoSlugField(populate_from=b'name', editable=False)),
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
                ('description', models.TextField()),
                ('dossiers', models.ManyToManyField(related_name='themes', to='representatives_votes.Dossier')),
                ('positions', models.ManyToManyField(related_name='themes', to='representatives_positions.Position')),
                ('proposals', models.ManyToManyField(related_name='themes', to='representatives_votes.Proposal')),
            ],
        ),
        migrations.CreateModel(
            name='ThemeLink',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('title', models.CharField(max_length=511)),
                ('datetime', models.DateField()),
                ('link', models.URLField(max_length=500)),
                ('theme', models.ForeignKey(related_name='links', to='memopol_themes.Theme')),
            ],
        ),
    ]