Beispiel #1
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('appmngt', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalPerson',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('phone_number',
                 phonenumber_field.modelfields.PhoneNumberField(
                     blank=True, max_length=128, verbose_name='Phone number')),
                ('email_address',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('web_site',
                 models.URLField(blank=True, verbose_name='Web site')),
                ('street', models.TextField(blank=True,
                                            verbose_name='street')),
                ('city',
                 models.CharField(blank=True,
                                  max_length=200,
                                  verbose_name='city')),
                ('province',
                 models.CharField(blank=True,
                                  max_length=200,
                                  verbose_name='province')),
                ('postal_code',
                 models.CharField(blank=True,
                                  max_length=10,
                                  verbose_name='postal code')),
                ('country',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='country')),
                ('about', models.TextField(blank=True, verbose_name='about')),
                ('first_name',
                 models.CharField(max_length=100, verbose_name='first name')),
                ('last_name',
                 models.CharField(max_length=200, verbose_name='last name')),
                ('title',
                 models.CharField(blank=True,
                                  max_length=200,
                                  verbose_name='title')),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_date', models.DateTimeField()),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical person',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalTeam',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('phone_number',
                 phonenumber_field.modelfields.PhoneNumberField(
                     blank=True, max_length=128, verbose_name='Phone number')),
                ('email_address',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('web_site',
                 models.URLField(blank=True, verbose_name='Web site')),
                ('street', models.TextField(blank=True,
                                            verbose_name='street')),
                ('city',
                 models.CharField(blank=True,
                                  max_length=200,
                                  verbose_name='city')),
                ('province',
                 models.CharField(blank=True,
                                  max_length=200,
                                  verbose_name='province')),
                ('postal_code',
                 models.CharField(blank=True,
                                  max_length=10,
                                  verbose_name='postal code')),
                ('country',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='country')),
                ('about', models.TextField(blank=True, verbose_name='about')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='Name')),
                ('departement',
                 models.CharField(max_length=100, verbose_name='Department')),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_date', models.DateTimeField()),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
                ('partner',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     default=None,
                     limit_choices_to={'status__in': ('On going', 'Released')},
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='appmngt.Partner',
                     verbose_name='Partner')),
            ],
            options={
                'verbose_name': 'historical team',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('phone_number',
                 phonenumber_field.modelfields.PhoneNumberField(
                     blank=True, max_length=128, verbose_name='Phone number')),
                ('email_address',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('web_site',
                 models.URLField(blank=True, verbose_name='Web site')),
                ('street', models.TextField(blank=True,
                                            verbose_name='street')),
                ('city',
                 models.CharField(blank=True,
                                  max_length=200,
                                  verbose_name='city')),
                ('province',
                 models.CharField(blank=True,
                                  max_length=200,
                                  verbose_name='province')),
                ('postal_code',
                 models.CharField(blank=True,
                                  max_length=10,
                                  verbose_name='postal code')),
                ('country',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='country')),
                ('about', models.TextField(blank=True, verbose_name='about')),
                ('first_name',
                 models.CharField(max_length=100, verbose_name='first name')),
                ('last_name',
                 models.CharField(max_length=200, verbose_name='last name')),
                ('title',
                 models.CharField(blank=True,
                                  max_length=200,
                                  verbose_name='title')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Team',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('phone_number',
                 phonenumber_field.modelfields.PhoneNumberField(
                     blank=True, max_length=128, verbose_name='Phone number')),
                ('email_address',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('web_site',
                 models.URLField(blank=True, verbose_name='Web site')),
                ('street', models.TextField(blank=True,
                                            verbose_name='street')),
                ('city',
                 models.CharField(blank=True,
                                  max_length=200,
                                  verbose_name='city')),
                ('province',
                 models.CharField(blank=True,
                                  max_length=200,
                                  verbose_name='province')),
                ('postal_code',
                 models.CharField(blank=True,
                                  max_length=10,
                                  verbose_name='postal code')),
                ('country',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='country')),
                ('about', models.TextField(blank=True, verbose_name='about')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='Name')),
                ('departement',
                 models.CharField(max_length=100, verbose_name='Department')),
                ('partner',
                 models.ForeignKey(
                     blank=True,
                     default=None,
                     limit_choices_to={'status__in': ('On going', 'Released')},
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='team_partner',
                     to='appmngt.Partner',
                     verbose_name='Partner')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='person',
            name='team',
            field=models.ForeignKey(
                default=None,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='person_team',
                to='contactmngt.Team',
                verbose_name='Team'),
        ),
        migrations.AddField(
            model_name='historicalperson',
            name='team',
            field=models.ForeignKey(
                blank=True,
                db_constraint=False,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name='+',
                to='contactmngt.Team',
                verbose_name='Team'),
        ),
    ]
Beispiel #2
0
class Migration(migrations.Migration):
    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('AKModel', '0031_event_ordering'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalAK',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('name',
                 models.CharField(help_text='Name of the AK',
                                  max_length=256,
                                  verbose_name='Name')),
                ('short_name',
                 models.CharField(blank=True,
                                  help_text='Name displayed in the schedule',
                                  max_length=64,
                                  verbose_name='Short Name')),
                ('description',
                 models.TextField(blank=True,
                                  help_text='Description of the AK',
                                  verbose_name='Description')),
                ('link',
                 models.URLField(blank=True,
                                 help_text='Link to wiki page',
                                 verbose_name='Web Link')),
                ('reso',
                 models.BooleanField(
                     default=False,
                     help_text='Intends to submit a resolution',
                     verbose_name='Resolution Intention')),
                ('present',
                 models.BooleanField(help_text='Present results of this AK',
                                     null=True,
                                     verbose_name='Present this AK')),
                ('notes',
                 models.TextField(
                     blank=True,
                     help_text=
                     'Notes to organizers. These are public. For private notes, please send an e-mail.',
                     verbose_name='Organizational Notes')),
                ('interest',
                 models.IntegerField(default=-1,
                                     help_text='Expected number of people',
                                     verbose_name='Interest')),
                ('interest_counter',
                 models.IntegerField(
                     default=0,
                     help_text='People who have indicated interest online',
                     verbose_name='Interest Counter')),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('category',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     help_text='Category of the AK',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='AKModel.AKCategory',
                     verbose_name='Category')),
                ('event',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     help_text='Associated event',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='AKModel.Event',
                     verbose_name='Event')),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
                ('track',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     help_text='Track the AK belongs to',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='AKModel.AKTrack',
                     verbose_name='Track')),
            ],
            options={
                'verbose_name': 'historical AK',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('users', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Topic',
            fields=[
                ('slug',
                 models.CharField(max_length=32,
                                  primary_key=True,
                                  serialize=False,
                                  unique=True)),
                ('name', models.CharField(max_length=64)),
                ('icon', models.URLField(null=True)),
                ('description', models.TextField(null=True)),
                ('color', models.CharField(max_length=16)),
                ('style',
                 models.CharField(default='', max_length=256, null=True)),
                ('last_activity_at', models.DateTimeField(auto_now_add=True)),
                ('is_visible', models.BooleanField(default=True)),
                ('is_visible_on_main_page', models.BooleanField(default=True)),
            ],
            options={
                'db_table': 'topics',
                'ordering': ['-last_activity_at'],
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('slug',
                 models.CharField(db_index=True, max_length=128, unique=True)),
                ('type',
                 models.CharField(choices=[('post', 'Текст'),
                                           ('intro', '#intro'),
                                           ('link', 'Ссылка'),
                                           ('question', 'Вопрос'),
                                           ('pain', 'Расскажи где болит'),
                                           ('project', 'Проект'),
                                           ('referral', 'Рефералка'),
                                           ('battle', 'Батл')],
                                  db_index=True,
                                  default='post',
                                  max_length=32)),
                ('label',
                 django.contrib.postgres.fields.jsonb.JSONField(null=True)),
                ('title', models.TextField()),
                ('text', models.TextField()),
                ('html', models.TextField(null=True)),
                ('url', models.URLField(null=True)),
                ('image', models.URLField(null=True)),
                ('metadata',
                 django.contrib.postgres.fields.jsonb.JSONField(null=True)),
                ('created_at',
                 models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('last_activity_at',
                 models.DateTimeField(auto_now_add=True, db_index=True)),
                ('comment_count', models.IntegerField(default=0)),
                ('view_count', models.IntegerField(default=0)),
                ('upvotes', models.IntegerField(db_index=True, default=0)),
                ('is_visible', models.BooleanField(default=True)),
                ('is_visible_on_main_page', models.BooleanField(default=True)),
                ('is_commentable', models.BooleanField(default=True)),
                ('is_approved_by_moderator',
                 models.BooleanField(default=False)),
                ('is_public', models.BooleanField(default=False)),
                ('is_pinned_until', models.DateTimeField(null=True)),
                ('author',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='posts',
                     to='users.User')),
                ('topic',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='posts',
                     to='posts.Topic')),
            ],
            options={
                'db_table': 'posts',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='HistoricalPost',
            fields=[
                ('id',
                 models.UUIDField(db_index=True,
                                  default=uuid.uuid4,
                                  editable=False)),
                ('slug', models.CharField(db_index=True, max_length=128)),
                ('type',
                 models.CharField(choices=[('post', 'Текст'),
                                           ('intro', '#intro'),
                                           ('link', 'Ссылка'),
                                           ('question', 'Вопрос'),
                                           ('pain', 'Расскажи где болит'),
                                           ('project', 'Проект'),
                                           ('referral', 'Рефералка'),
                                           ('battle', 'Батл')],
                                  db_index=True,
                                  default='post',
                                  max_length=32)),
                ('label',
                 django.contrib.postgres.fields.jsonb.JSONField(null=True)),
                ('title', models.TextField()),
                ('text', models.TextField()),
                ('url', models.URLField(null=True)),
                ('image', models.URLField(null=True)),
                ('metadata',
                 django.contrib.postgres.fields.jsonb.JSONField(null=True)),
                ('is_visible', models.BooleanField(default=True)),
                ('is_visible_on_main_page', models.BooleanField(default=True)),
                ('is_commentable', models.BooleanField(default=True)),
                ('is_approved_by_moderator',
                 models.BooleanField(default=False)),
                ('is_public', models.BooleanField(default=False)),
                ('is_pinned_until', models.DateTimeField(null=True)),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('author',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='users.User')),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='users.User')),
                ('topic',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='posts.Topic')),
            ],
            options={
                'verbose_name': 'historical post',
                'db_table': 'posts_history',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='PostVote',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('post',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='votes',
                                   to='posts.Post')),
                ('user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='post_votes',
                     to='users.User')),
            ],
            options={
                'db_table': 'post_votes',
                'unique_together': {('user', 'post')},
            },
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("datasets", "0020_auto_20200718_2347"),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalCityCouncilAttendanceList",
            fields=[
                (
                    "id",
                    models.IntegerField(auto_created=True,
                                        blank=True,
                                        db_index=True,
                                        verbose_name="ID"),
                ),
                (
                    "created_at",
                    models.DateTimeField(blank=True,
                                         editable=False,
                                         verbose_name="Criado em"),
                ),
                (
                    "updated_at",
                    models.DateTimeField(blank=True,
                                         editable=False,
                                         verbose_name="Atualizado em"),
                ),
                ("crawled_at",
                 models.DateTimeField(verbose_name="Coletado em")),
                ("crawled_from", models.URLField(verbose_name="Fonte")),
                (
                    "notes",
                    models.TextField(blank=True,
                                     null=True,
                                     verbose_name="Anotações"),
                ),
                ("date", models.DateField(verbose_name="Data")),
                (
                    "description",
                    models.CharField(blank=True,
                                     max_length=200,
                                     null=True,
                                     verbose_name="Descrição"),
                ),
                (
                    "council_member",
                    models.CharField(db_index=True,
                                     max_length=200,
                                     verbose_name="Vereador"),
                ),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("presente", "Presente"),
                            ("falta_justificada", "Falta Justificada"),
                            ("licenca_justificada", "Licença Justificada"),
                            ("ausente", "Ausente"),
                        ],
                        db_index=True,
                        max_length=20,
                        verbose_name="Situação",
                    ),
                ),
                ("history_id",
                 models.AutoField(primary_key=True, serialize=False)),
                ("history_date", models.DateTimeField()),
                ("history_change_reason",
                 models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"),
                                 ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name":
                "historical Câmara de Vereadores - Lista de Presença",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]