class Migration(migrations.Migration):

    dependencies = [
        ('order', '0018_historicalline_historicalorder'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('refund', '0005_auto_20180628_2011'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalRefund',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('total_credit_excl_tax', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Total Credit (excl. tax)')),
                ('currency', models.CharField(default=oscar.core.utils.get_default_currency, max_length=12, verbose_name='Currency')),
                ('status', models.CharField(choices=[(b'Open', b'Open'), (b'Denied', b'Denied'), (b'Payment Refund Error', b'Payment Refund Error'), (b'Payment Refunded', b'Payment Refunded'), (b'Revocation Error', b'Revocation Error'), (b'Complete', b'Complete')], max_length=255, verbose_name='Status')),
                ('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)),
                ('order', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='order.Order', verbose_name='Order')),
                ('user', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='User')),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical refund',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalRefundLine',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('line_credit_excl_tax', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Line Credit (excl. tax)')),
                ('quantity', models.PositiveIntegerField(default=1, verbose_name='Quantity')),
                ('status', models.CharField(choices=[(b'Open', b'Open'), (b'Revocation Error', b'Revocation Error'), (b'Denied', b'Denied'), (b'Complete', b'Complete')], max_length=255, verbose_name='Status')),
                ('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)),
                ('order_line', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='order.Line', verbose_name='Order Line')),
                ('refund', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='refund.Refund', verbose_name='Refund')),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical refund line',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('adserver_auth', '0003_allow-blank'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalUser',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('email', models.EmailField(db_index=True, max_length=254, null=True)),
                ('name', models.CharField(blank=True, default='', max_length=255, verbose_name='name')),
                ('is_staff', models.BooleanField(default=False, help_text='Is the user allowed to have access to the admin', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('updated_date', models.DateTimeField(blank=True, editable=False, verbose_name='update date')),
                ('created_date', models.DateTimeField(blank=True, editable=False, verbose_name='create date')),
                ('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 user',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Пример #3
0
class Migration(migrations.Migration):
    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('student', '0027_courseenrollment_mode_callable_default'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalManualEnrollmentAudit',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('enrolled_email', models.CharField(db_index=True, max_length=255)),
                ('time_stamp', models.DateTimeField(blank=True, editable=False, null=True)),
                ('state_transition', models.CharField(choices=[('from unenrolled to allowed to enroll', 'from unenrolled to allowed to enroll'), ('from allowed to enroll to enrolled', 'from allowed to enroll to enrolled'), ('from enrolled to enrolled', 'from enrolled to enrolled'), ('from enrolled to unenrolled', 'from enrolled to unenrolled'), ('from unenrolled to enrolled', 'from unenrolled to enrolled'), ('from allowed to enroll to enrolled', 'from allowed to enroll to enrolled'), ('from unenrolled to unenrolled', 'from unenrolled to unenrolled'), ('N/A', 'N/A')], max_length=255)),
                ('reason', models.TextField(null=True)),
                ('role', models.CharField(blank=True, max_length=64, 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)),
                ('enrolled_by', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('enrollment', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='student.CourseEnrollment')),
                ('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 manual enrollment audit',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('sites', '0002_alter_domain_unique'),
        ('partner', '0014_historicalstockrecord'),
        ('courses', '0010_migrate_partner_data_to_courses'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalCourse',
            fields=[
                ('id', models.CharField(db_index=True, max_length=255, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('verification_deadline', models.DateTimeField(blank=True, help_text='Last date/time on which verification for this product can be submitted.', null=True)),
                ('created', models.DateTimeField(blank=True, editable=False, null=True)),
                ('modified', models.DateTimeField(blank=True, editable=False, null=True)),
                ('thumbnail_url', models.URLField(blank=True, 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)),
                ('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, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='partner.Partner')),
                ('site', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='sites.Site', verbose_name='Site')),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical course',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Пример #5
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('sites', '0002_alter_domain_unique'),
        ('partner', '0014_historicalstockrecord'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalPartner',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=128, verbose_name='Name')),
                ('short_code', models.CharField(db_index=True, max_length=8)),
                ('enable_sailthru', models.BooleanField(default=True, help_text=b'DEPRECATED: Use SiteConfiguration!', verbose_name='Enable Sailthru Reporting')),
                ('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)),
                ('default_site', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='sites.Site')),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical Partner',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('core', '0051_ecommercefeatureroleassignment_enterprise_id'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalBusinessClient',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=255, verbose_name='Name')),
                ('enterprise_customer_uuid', models.UUIDField(blank=True, help_text='UUID for an EnterpriseCustomer from the Enterprise Service.', null=True, verbose_name='EnterpriseCustomer UUID')),
                ('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={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical business client',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Пример #7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalProgramEnrollment',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('external_user_key', models.CharField(db_index=True, max_length=255, null=True)),
                ('program_uuid', models.UUIDField(db_index=True)),
                ('curriculum_uuid', models.UUIDField(db_index=True)),
                ('status', models.CharField(choices=[('enrolled', 'enrolled'), ('pending', 'pending'), ('suspended', 'suspended'), ('withdrawn', 'withdrawn')], max_length=9)),
                ('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)),
                ('user', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical program enrollment',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='ProgramEnrollment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('external_user_key', models.CharField(db_index=True, max_length=255, null=True)),
                ('program_uuid', models.UUIDField(db_index=True)),
                ('curriculum_uuid', models.UUIDField(db_index=True)),
                ('status', models.CharField(choices=[('enrolled', 'enrolled'), ('pending', 'pending'), ('suspended', 'suspended'), ('withdrawn', 'withdrawn')], max_length=9)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #8
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('sites', '0002_update_default_site'),
        ('notice_board', '0007_alter_sphere_site_related_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalSphere',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('history_change_reason', models.TextField(null=True)),
                ('is_open', models.BooleanField(default=True)),
                ('name', models.CharField(max_length=255)),
                ('settings',
                 common.json_field.PostgreSQLJSONField(
                     default=notice_board.models.default_sphere_settings)),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('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)),
                ('site',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='sites.Site')),
            ],
            options={
                'verbose_name': 'historical sphere',
                'db_table': 'nb_sphere_history',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Пример #9
0
class Migration(migrations.Migration):
    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('experiments', '0003_auto_20170713_1148'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalExperimentKeyValue',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('experiment_id',
                 models.PositiveSmallIntegerField(
                     db_index=True, verbose_name='Experiment ID')),
                ('key', models.CharField(max_length=255)),
                ('value', models.TextField()),
                ('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={
                'get_latest_by': 'history_date',
                'verbose_name': 'historical Experiment Key-Value Pair',
                'ordering': ('-history_date', '-history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("search", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalExcludeFromSearch",
            fields=[
                (
                    "id",
                    models.IntegerField(auto_created=True,
                                        blank=True,
                                        db_index=True,
                                        verbose_name="ID"),
                ),
                ("term", models.CharField(max_length=255)),
                ("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 exclude from search",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("tests", "0015_historicalmodeltest"),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalRelatedModelTest",
            fields=[
                ("id", models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name="ID"),),
                ("char_field", models.CharField(max_length=255, verbose_name="Char")),
                ("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,
                    ),
                ),
                (
                    "model_test",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="tests.ModelTest",
                        verbose_name="Model Test",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical Related Model Test",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Пример #12
0
class Migration(migrations.Migration):

    dependencies = [
        ('catalogue', '0039_historicalproduct_historicalproductattributevalue'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('partner', '0013_partner_default_site'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalStockRecord',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('partner_sku', models.CharField(max_length=128, verbose_name='Partner SKU')),
                ('price_currency', models.CharField(default=oscar.core.utils.get_default_currency, max_length=12, verbose_name='Currency')),
                ('price_excl_tax', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, verbose_name='Price (excl. tax)')),
                ('price_retail', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, verbose_name='Price (retail)')),
                ('cost_price', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, verbose_name='Cost Price')),
                ('num_in_stock', models.PositiveIntegerField(blank=True, null=True, verbose_name='Number in stock')),
                ('num_allocated', models.IntegerField(blank=True, null=True, verbose_name='Number allocated')),
                ('low_stock_threshold', models.PositiveIntegerField(blank=True, null=True, verbose_name='Low Stock Threshold')),
                ('date_created', models.DateTimeField(blank=True, editable=False, verbose_name='Date created')),
                ('date_updated', models.DateTimeField(blank=True, db_index=True, editable=False, verbose_name='Date updated')),
                ('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)),
                ('partner', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='partner.Partner', verbose_name='Partner')),
                ('product', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='catalogue.Product', verbose_name='Product')),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical Stock record',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Пример #13
0
class Migration(migrations.Migration):
    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='ExternalId',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('external_user_id', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ExternalIdType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(db_index=True, max_length=32, unique=True)),
                ('description', models.TextField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='HistoricalExternalId',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('external_user_id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
                ('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)),
                ('external_id_type', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='external_user_ids.ExternalIdType')),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical external id',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalExternalIdType',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(db_index=True, max_length=32)),
                ('description', models.TextField()),
                ('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={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical external id type',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.AddField(
            model_name='externalid',
            name='external_id_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='external_user_ids.ExternalIdType'),
        ),
        migrations.AddField(
            model_name='externalid',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('catalogue', '0039_historicalproduct_historicalproductattributevalue'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalCategory',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('path', models.CharField(db_index=True, max_length=255)),
                ('depth', models.PositiveIntegerField()),
                ('numchild', models.PositiveIntegerField(default=0)),
                ('name', models.CharField(db_index=True, max_length=255, verbose_name='Name')),
                ('description', models.TextField(blank=True, verbose_name='Description')),
                ('image', models.TextField(blank=True, max_length=255, null=True, verbose_name='Image')),
                ('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={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical Category',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalOption',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('name', models.CharField(max_length=128, verbose_name='Name')),
                ('type', models.CharField(choices=[(b'Required', 'Required - a value for this option must be specified'), (b'Optional', 'Optional - a value for this option can be omitted')], default=b'Required', max_length=128, verbose_name='Status')),
                ('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={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical Option',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalProductAttribute',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('name', models.CharField(max_length=128, verbose_name='Name')),
                ('code', models.SlugField(max_length=128, validators=[django.core.validators.RegexValidator(message="Code can only contain the letters a-z, A-Z, digits, and underscores, and can't start with a digit.", regex=b'^[a-zA-Z_][0-9a-zA-Z_]*$'), oscar.core.validators.non_python_keyword], verbose_name='Code')),
                ('type', models.CharField(choices=[(b'text', 'Text'), (b'integer', 'Integer'), (b'boolean', 'True / False'), (b'float', 'Float'), (b'richtext', 'Rich Text'), (b'date', 'Date'), (b'datetime', b'Datetime'), (b'option', 'Option'), (b'multi_option', 'Multi Option'), (b'entity', 'Entity'), (b'file', 'File'), (b'image', 'Image')], default=b'text', max_length=20, verbose_name='Type')),
                ('required', models.BooleanField(default=False, verbose_name='Required')),
                ('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)),
                ('option_group', models.ForeignKey(blank=True, db_constraint=False, help_text='Select an option group if using type "Option" or "Multi Option"', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='catalogue.AttributeOptionGroup', verbose_name='Option Group')),
                ('product_class', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='catalogue.ProductClass', verbose_name='Product type')),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical Product attribute',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalProductCategory',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('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, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='catalogue.Category', verbose_name='Category')),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('product', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='catalogue.Product', verbose_name='Product')),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical Product category',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalProductClass',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('name', models.CharField(max_length=128, verbose_name='Name')),
                ('requires_shipping', models.BooleanField(default=True, verbose_name='Requires shipping?')),
                ('track_stock', models.BooleanField(default=True, verbose_name='Track stock levels?')),
                ('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={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical Product class',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Пример #15
0
class Migration(migrations.Migration):
    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("auth", "0011_update_proxy_permissions"),
        ("workstation_configs", "0001_squashed_0008_auto_20201001_0758"),
    ]

    operations = [
        migrations.CreateModel(
            name="Workstation",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("modified", models.DateTimeField(auto_now=True)),
                (
                    "title",
                    models.CharField(max_length=255, verbose_name="title"),
                ),
                (
                    "description",
                    models.TextField(blank=True,
                                     null=True,
                                     verbose_name="description"),
                ),
                (
                    "slug",
                    django_extensions.db.fields.AutoSlugField(
                        blank=True,
                        editable=False,
                        populate_from="title",
                        verbose_name="slug",
                    ),
                ),
                (
                    "logo",
                    models.ImageField(
                        storage=grandchallenge.core.storage.PublicS3Storage(),
                        upload_to=grandchallenge.core.storage.get_logo_path,
                    ),
                ),
                (
                    "editors_group",
                    models.OneToOneField(
                        editable=False,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="editors_of_workstation",
                        to="auth.group",
                    ),
                ),
                (
                    "users_group",
                    models.OneToOneField(
                        editable=False,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="users_of_workstation",
                        to="auth.group",
                    ),
                ),
                (
                    "config",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="workstation_configs.workstationconfig",
                    ),
                ),
                (
                    "public",
                    models.BooleanField(
                        default=False,
                        help_text=
                        "If True, all logged in users can use this workstation, otherwise, only the users group can use this workstation.",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "ordering": ("created", "title")
            },
        ),
        migrations.CreateModel(
            name="WorkstationImage",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("modified", models.DateTimeField(auto_now=True)),
                (
                    "staged_image_uuid",
                    models.UUIDField(blank=True, editable=False, null=True),
                ),
                (
                    "image",
                    models.FileField(
                        blank=True,
                        help_text=
                        ".tar.xz archive of the container image produced from the command 'docker save IMAGE | xz -c > IMAGE.tar.xz'. See https://docs.docker.com/engine/reference/commandline/save/",
                        storage=grandchallenge.core.storage.PrivateS3Storage(),
                        upload_to=grandchallenge.components.models.
                        docker_image_path,
                        validators=[
                            grandchallenge.core.validators.ExtensionValidator(
                                allowed_extensions=(
                                    ".tar",
                                    ".tar.gz",
                                    ".tar.xz",
                                ))
                        ],
                    ),
                ),
                (
                    "image_sha256",
                    models.CharField(editable=False, max_length=71),
                ),
                (
                    "ready",
                    models.BooleanField(
                        default=False,
                        editable=False,
                        help_text="Is this image ready to be used?",
                    ),
                ),
                ("status", models.TextField(editable=False)),
                ("requires_gpu", models.BooleanField(default=False)),
                (
                    "requires_gpu_memory_gb",
                    models.PositiveIntegerField(default=4),
                ),
                ("requires_memory_gb", models.PositiveIntegerField(default=4)),
                (
                    "requires_cpu_cores",
                    models.DecimalField(decimal_places=2,
                                        default=Decimal("1.0"),
                                        max_digits=4),
                ),
                (
                    "http_port",
                    models.PositiveIntegerField(
                        default=8080,
                        validators=[
                            django.core.validators.MaxValueValidator(65535)
                        ],
                    ),
                ),
                (
                    "websocket_port",
                    models.PositiveIntegerField(
                        default=4114,
                        validators=[
                            django.core.validators.MaxValueValidator(65535)
                        ],
                    ),
                ),
                (
                    "initial_path",
                    models.CharField(
                        default="cirrus",
                        max_length=256,
                        validators=[
                            django.core.validators.RegexValidator(
                                message=
                                "This path is invalid, it must not start with a /",
                                regex="^(?:[^/][^\\s]*)\\Z",
                            )
                        ],
                    ),
                ),
                (
                    "creator",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "workstation",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="workstations.workstation",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "ordering": ("created", "creator")
            },
        ),
        migrations.CreateModel(
            name="HistoricalSession",
            fields=[
                (
                    "id",
                    models.UUIDField(db_index=True,
                                     default=uuid.uuid4,
                                     editable=False),
                ),
                ("created", models.DateTimeField(blank=True, editable=False)),
                ("modified", models.DateTimeField(blank=True, editable=False)),
                (
                    "status",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Queued"),
                            (1, "Started"),
                            (2, "Running"),
                            (3, "Failed"),
                            (4, "Stopped"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "maximum_duration",
                    models.DurationField(default=datetime.timedelta(
                        seconds=600)),
                ),
                ("user_finished", models.BooleanField(default=False)),
                (
                    "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,
                    ),
                ),
                (
                    "creator",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "workstation_image",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="workstations.workstationimage",
                    ),
                ),
                (
                    "region",
                    models.CharField(
                        choices=[
                            ("af-south-1", "Africa (Cape Town)"),
                            ("ap-east-1", "Asia Pacific (Hong Kong)"),
                            ("ap-northeast-1", "Asia Pacific (Tokyo)"),
                            ("ap-northeast-2", "Asia Pacific (Seoul)"),
                            ("ap-northeast-3", "Asia Pacific (Osaka-Local)"),
                            ("ap-south-1", "Asia Pacific (Mumbai)"),
                            ("ap-southeast-1", "Asia Pacific (Singapore)"),
                            ("ap-southeast-2", "Asia Pacific (Sydney)"),
                            ("ca-central-1", "Canada (Central)"),
                            ("eu-central-1", "Europe (Frankfurt)"),
                            ("eu-north-1", "Europe (Stockholm)"),
                            ("eu-south-1", "Europe (Milan)"),
                            ("eu-west-1", "Europe (Ireland)"),
                            ("eu-west-2", "Europe (London)"),
                            ("eu-west-3", "Europe (Paris)"),
                            ("me-south-1", "Middle East (Bahrain)"),
                            ("sa-east-1", "South America (São Paulo)"),
                            ("us-east-1", "US East (N. Virginia)"),
                            ("us-east-2", "US East (Ohio)"),
                            ("us-west-1", "US West (N. California)"),
                            ("us-west-2", "US West (Oregon)"),
                            ("eu-nl-1", "Netherlands (Nijmegen)"),
                            ("eu-nl-2", "Netherlands (Amsterdam)"),
                        ],
                        default="eu-nl-1",
                        help_text="Which region is this session available in?",
                        max_length=14,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical session",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="Session",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("modified", models.DateTimeField(auto_now=True)),
                (
                    "status",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Queued"),
                            (1, "Started"),
                            (2, "Running"),
                            (3, "Failed"),
                            (4, "Stopped"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "maximum_duration",
                    models.DurationField(default=datetime.timedelta(
                        seconds=600)),
                ),
                ("user_finished", models.BooleanField(default=False)),
                (
                    "creator",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "workstation_image",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="workstations.workstationimage",
                    ),
                ),
                ("logs", models.TextField(blank=True, editable=False)),
                (
                    "region",
                    models.CharField(
                        choices=[
                            ("af-south-1", "Africa (Cape Town)"),
                            ("ap-east-1", "Asia Pacific (Hong Kong)"),
                            ("ap-northeast-1", "Asia Pacific (Tokyo)"),
                            ("ap-northeast-2", "Asia Pacific (Seoul)"),
                            ("ap-northeast-3", "Asia Pacific (Osaka-Local)"),
                            ("ap-south-1", "Asia Pacific (Mumbai)"),
                            ("ap-southeast-1", "Asia Pacific (Singapore)"),
                            ("ap-southeast-2", "Asia Pacific (Sydney)"),
                            ("ca-central-1", "Canada (Central)"),
                            ("eu-central-1", "Europe (Frankfurt)"),
                            ("eu-north-1", "Europe (Stockholm)"),
                            ("eu-south-1", "Europe (Milan)"),
                            ("eu-west-1", "Europe (Ireland)"),
                            ("eu-west-2", "Europe (London)"),
                            ("eu-west-3", "Europe (Paris)"),
                            ("me-south-1", "Middle East (Bahrain)"),
                            ("sa-east-1", "South America (São Paulo)"),
                            ("us-east-1", "US East (N. Virginia)"),
                            ("us-east-2", "US East (Ohio)"),
                            ("us-west-1", "US West (N. California)"),
                            ("us-west-2", "US West (Oregon)"),
                            ("eu-nl-1", "Netherlands (Nijmegen)"),
                            ("eu-nl-2", "Netherlands (Amsterdam)"),
                        ],
                        default="eu-nl-1",
                        help_text="Which region is this session available in?",
                        max_length=14,
                    ),
                ),
                ("ping_times", models.JSONField(default=None, null=True)),
            ],
            options={
                "abstract": False,
                "ordering": ("created", "creator")
            },
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("barriers", "0012_auto_20180924_1654"),
    ]

    operations = [
        migrations.CreateModel(
            name="BarrierCompany",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_on",
                    models.DateTimeField(auto_now_add=True, db_index=True, null=True),
                ),
                ("modified_on", models.DateTimeField(auto_now=True, null=True)),
                ("company_id", models.UUIDField(help_text="Data hub company UUID")),
                (
                    "company_name",
                    models.CharField(help_text="Data hub company name", max_length=255),
                ),
                (
                    "barrier",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="companies",
                        to="barriers.BarrierInstance",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "modified_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="HistoricalBarrierCompany",
            fields=[
                (
                    "id",
                    models.IntegerField(
                        auto_created=True, blank=True, db_index=True, verbose_name="ID"
                    ),
                ),
                (
                    "created_on",
                    models.DateTimeField(
                        blank=True, db_index=True, editable=False, null=True
                    ),
                ),
                (
                    "modified_on",
                    models.DateTimeField(blank=True, editable=False, null=True),
                ),
                ("company_id", models.UUIDField(help_text="Data hub company UUID")),
                (
                    "company_name",
                    models.CharField(help_text="Data hub company name", max_length=255),
                ),
                ("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,
                    ),
                ),
                (
                    "barrier",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="barriers.BarrierInstance",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "modified_by",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical barrier company",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.AlterUniqueTogether(
            name="barriercompany", unique_together={("barrier", "company_id")}
        ),
    ]
Пример #17
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('basket', '0011_add_email_basket_attribute_type'),
        ('order', '0017_order_partner'),
        ('core', '0051_ecommercefeatureroleassignment_enterprise_id'),
        ('invoice', '0006_auto_20180228_1057'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalInvoice',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='created')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modified')),
                ('state',
                 models.CharField(choices=[(b'Not Paid', 'Not Paid'),
                                           (b'Paid', 'Paid')],
                                  default=b'Not Paid',
                                  max_length=255)),
                ('number',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('type',
                 models.CharField(blank=True,
                                  choices=[(b'Prepaid', 'Prepaid'),
                                           (b'Postpaid', 'Postpaid'),
                                           (b'Bulk purchase', 'Bulk purchase'),
                                           (b'Not applicable',
                                            'Not applicable')],
                                  default=b'Prepaid',
                                  max_length=255,
                                  null=True)),
                ('payment_date', models.DateTimeField(blank=True, null=True)),
                ('discount_type',
                 models.CharField(blank=True,
                                  choices=[(b'Percentage', 'Percentage'),
                                           (b'Fixed', 'Fixed')],
                                  default=b'Percentage',
                                  max_length=255,
                                  null=True)),
                ('discount_value',
                 models.PositiveIntegerField(blank=True, null=True)),
                ('tax_deducted_source',
                 models.PositiveIntegerField(
                     blank=True,
                     null=True,
                     validators=[
                         django.core.validators.MinValueValidator(1),
                         django.core.validators.MaxValueValidator(100)
                     ])),
                ('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)),
                ('basket',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='basket.Basket')),
                ('business_client',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='core.BusinessClient')),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
                ('order',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='order.Order')),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical invoice',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Пример #18
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("barriers", "0020_auto_20181025_1545"),
        ("documents", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="Document",
            fields=[
                (
                    "created_on",
                    models.DateTimeField(auto_now_add=True, db_index=True, null=True),
                ),
                ("modified_on", models.DateTimeField(auto_now=True, null=True)),
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4, primary_key=True, serialize=False
                    ),
                ),
                ("original_filename", models.CharField(max_length=255)),
                ("size", models.IntegerField(null=True)),
                ("mime_type", models.CharField(max_length=255, null=True)),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "document",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="documents.Document",
                    ),
                ),
                (
                    "modified_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={"abstract": False},
        ),
        migrations.CreateModel(
            name="HistoricalDocument",
            fields=[
                (
                    "created_on",
                    models.DateTimeField(
                        blank=True, db_index=True, editable=False, null=True
                    ),
                ),
                (
                    "modified_on",
                    models.DateTimeField(blank=True, editable=False, null=True),
                ),
                ("id", models.UUIDField(db_index=True, default=uuid.uuid4)),
                ("original_filename", models.CharField(max_length=255)),
                ("size", models.IntegerField(null=True)),
                ("mime_type", models.CharField(max_length=255, null=True)),
                ("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,
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "document",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="documents.Document",
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "modified_by",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical document",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalInteraction",
            fields=[
                (
                    "id",
                    models.IntegerField(
                        auto_created=True, blank=True, db_index=True, verbose_name="ID"
                    ),
                ),
                (
                    "created_on",
                    models.DateTimeField(
                        blank=True, db_index=True, editable=False, null=True
                    ),
                ),
                (
                    "modified_on",
                    models.DateTimeField(blank=True, editable=False, null=True),
                ),
                (
                    "kind",
                    models.CharField(choices=[("COMMENT", "Comment")], max_length=25),
                ),
                ("text", models.TextField(null=True)),
                ("pinned", models.BooleanField(default=False)),
                ("is_active", models.BooleanField(default=True)),
                ("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,
                    ),
                ),
                (
                    "barrier",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="barriers.BarrierInstance",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "modified_by",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical interaction",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="Interaction",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_on",
                    models.DateTimeField(auto_now_add=True, db_index=True, null=True),
                ),
                ("modified_on", models.DateTimeField(auto_now=True, null=True)),
                (
                    "kind",
                    models.CharField(choices=[("COMMENT", "Comment")], max_length=25),
                ),
                ("text", models.TextField(null=True)),
                ("pinned", models.BooleanField(default=False)),
                ("is_active", models.BooleanField(default=True)),
                (
                    "barrier",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="interactions_documents",
                        to="barriers.BarrierInstance",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "documents",
                    models.ManyToManyField(
                        help_text="Interaction documents",
                        related_name="documents",
                        to="interactions.Document",
                    ),
                ),
                (
                    "modified_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={"abstract": False},
        ),
    ]
Пример #19
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('permits', '0004_insert_workflow_status'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalWorksObjectPropertyValue',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('value', django.contrib.postgres.fields.jsonb.JSONField()),
                ('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)),
                ('property',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='permits.WorksObjectProperty',
                     verbose_name='caractéristique')),
                ('works_object_type_choice',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='permits.WorksObjectTypeChoice',
                     verbose_name='objet des travaux')),
            ],
            options={
                'verbose_name': 'historical works object property value',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalPermitRequestValidation',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('validation_status',
                 models.IntegerField(choices=[(0, 'En attente'),
                                              (1, 'Approuvé'), (2, 'Refusé')],
                                     default=0,
                                     verbose_name='Statut de validation')),
                ('comment_before',
                 models.TextField(blank=True,
                                  verbose_name='Commentaires (avant)')),
                ('comment_during',
                 models.TextField(blank=True,
                                  verbose_name='Commentaires (pendant)')),
                ('comment_after',
                 models.TextField(blank=True,
                                  verbose_name='Commentaires (après)')),
                ('validated_at',
                 models.DateTimeField(null=True, verbose_name='Validé le')),
                ('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)),
                ('department',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='permits.PermitDepartment')),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
                ('permit_request',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='permits.PermitRequest')),
                ('validated_by',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name':
                'historical 3.5 Consultation de la validation par le service',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalPermitRequestGeoTime',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('starts_at',
                 models.DateTimeField(verbose_name='Date planifiée de début')),
                ('ends_at',
                 models.DateTimeField(verbose_name='Date planifiée de fin')),
                ('comment',
                 models.CharField(blank=True,
                                  max_length=1024,
                                  verbose_name='Commentaire')),
                ('external_link',
                 models.URLField(blank=True, verbose_name='Lien externe')),
                ('geom',
                 django.contrib.gis.db.models.fields.GeometryCollectionField(
                     null=True, srid=2056, verbose_name='Localisation')),
                ('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)),
                ('permit_request',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='permits.PermitRequest')),
            ],
            options={
                'verbose_name':
                "historical 3.3 Consultation de l'agenda et de la géométrie",
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalPermitRequest',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('status',
                 models.PositiveSmallIntegerField(choices=[
                     (0, 'Brouillon'),
                     (1, 'Envoyée, en attente de traitement'),
                     (4, 'Demande de compléments'), (3, 'En traitement'),
                     (5, 'En validation'), (2, 'Approuvée'), (6, 'Refusée'),
                     (7, 'Annonce réceptionnée')
                 ],
                                                  default=0,
                                                  verbose_name='état')),
                ('created_at',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date de création')),
                ('validated_at',
                 models.DateTimeField(null=True,
                                      verbose_name='date de validation')),
                ('printed_at',
                 models.DateTimeField(null=True,
                                      verbose_name="date d'impression")),
                ('printed_by',
                 models.CharField(blank=True,
                                  max_length=255,
                                  verbose_name='imprimé par')),
                ('printed_file',
                 models.TextField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Permis imprimé')),
                ('archeology_status',
                 models.PositiveSmallIntegerField(
                     choices=[(0, 'Non pertinent'), (1, 'Inconnu'),
                              (2, 'Pas fouillé'), (3, 'Partiellement fouillé'),
                              (4, 'Déjà fouillé')],
                     default=0,
                     verbose_name='Statut archéologique')),
                ('intersected_geometries',
                 models.CharField(
                     max_length=1024,
                     null=True,
                     verbose_name='Entités géométriques concernées')),
                ('price',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     max_digits=7,
                                     null=True,
                                     verbose_name='Émolument')),
                ('exemption',
                 models.TextField(blank=True, verbose_name='Dérogation')),
                ('opposition',
                 models.TextField(blank=True, verbose_name='Opposition')),
                ('comment',
                 models.TextField(blank=True,
                                  verbose_name='Analyse du service pilote')),
                ('validation_pdf',
                 models.TextField(
                     max_length=100,
                     validators=[
                         django.core.validators.FileExtensionValidator(
                             allowed_extensions=['pdf'])
                     ],
                     verbose_name='pdf de validation')),
                ('creditor_type',
                 models.PositiveSmallIntegerField(
                     blank=True,
                     choices=[
                         (0, 'Autres'), (2, 'Propriétaire'), (3, 'Entreprise'),
                         (4, "Maître d'ouvrage"),
                         (1,
                          "Requérant si différent de l'auteur de la demande"),
                         (5, 'Sécurité'), (6, 'Association')
                     ],
                     null=True,
                     verbose_name='Destinaire de la facture')),
                ('is_public',
                 models.BooleanField(default=False, verbose_name='Publier')),
                ('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)),
                ('administrative_entity',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='permits.PermitAdministrativeEntity',
                     verbose_name='commune')),
                ('author',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='permits.PermitAuthor',
                     verbose_name='auteur')),
                ('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 3.1 Consultation de la demande',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalPermitAuthor',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('company_name',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='Raison Sociale')),
                ('vat_number',
                 models.CharField(
                     blank=True,
                     max_length=19,
                     validators=[
                         django.core.validators.RegexValidator(
                             message=
                             "Le code d'entreprise doit être de type                          CHE-123.456.789 (TVA)                          et vous pouvez le trouver sur                          le registe fédéral des entreprises                          https://www.uid.admin.ch/search.aspx",
                             regex='^(CHE-)+\\d{3}\\.\\d{3}\\.\\d{3}(\\sTVA)?$'
                         )
                     ],
                     verbose_name='Numéro TVA')),
                ('address', models.CharField(max_length=100,
                                             verbose_name='Rue')),
                ('zipcode',
                 models.PositiveIntegerField(validators=[
                     django.core.validators.MinValueValidator(1000),
                     django.core.validators.MaxValueValidator(9999)
                 ],
                                             verbose_name='NPA')),
                ('city', models.CharField(max_length=100,
                                          verbose_name='Ville')),
                ('phone_first',
                 models.CharField(
                     max_length=20,
                     validators=[
                         django.core.validators.RegexValidator(
                             message=
                             'Seuls les chiffres et les espaces sont autorisés.',
                             regex=
                             '^(((\\+41)\\s?)|(0))?(\\d{2})\\s?(\\d{3})\\s?(\\d{2})\\s?(\\d{2})$'
                         )
                     ],
                     verbose_name='Téléphone principal')),
                ('phone_second',
                 models.CharField(
                     blank=True,
                     max_length=20,
                     validators=[
                         django.core.validators.RegexValidator(
                             message=
                             'Seuls les chiffres et les espaces sont autorisés.',
                             regex=
                             '^(((\\+41)\\s?)|(0))?(\\d{2})\\s?(\\d{3})\\s?(\\d{2})\\s?(\\d{2})$'
                         )
                     ],
                     verbose_name='Téléphone secondaire')),
                ('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)),
                ('user',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': "historical 3.2 Consultation de l'auteur",
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalPermitActor',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('first_name',
                 models.CharField(max_length=150, verbose_name='Prénom')),
                ('last_name',
                 models.CharField(max_length=100, verbose_name='Nom')),
                ('company_name',
                 models.CharField(max_length=100, verbose_name='Entreprise')),
                ('vat_number',
                 models.CharField(blank=True,
                                  max_length=19,
                                  verbose_name='Numéro TVA')),
                ('address',
                 models.CharField(max_length=100, verbose_name='Adresse')),
                ('zipcode', models.PositiveIntegerField(verbose_name='NPA')),
                ('city', models.CharField(max_length=100,
                                          verbose_name='Ville')),
                ('phone',
                 models.CharField(max_length=20, verbose_name='Téléphone')),
                ('email',
                 models.EmailField(max_length=254, verbose_name='Email')),
                ('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 Contact',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Пример #20
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('enterprise', '0107_remove_branding_config_banner_fields'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalCanvasEnterpriseCustomerConfiguration',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('active',
                 models.BooleanField(
                     help_text='Is this configuration active?')),
                ('transmission_chunk_size',
                 models.IntegerField(
                     default=500,
                     help_text=
                     'The maximum number of data items to transmit to the integrated channel with each request.'
                 )),
                ('channel_worker_username',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Enterprise channel worker username to get JWT tokens for authenticating LMS APIs.',
                     max_length=255,
                     null=True)),
                ('catalogs_to_transmit',
                 models.TextField(
                     blank=True,
                     help_text=
                     'A comma-separated list of catalog UUIDs to transmit.',
                     null=True)),
                ('client_id',
                 models.CharField(
                     help_text=
                     'The API Client ID provided to edX by the enterprise customer to be used to make API calls to Canvas on behalf of the customer.',
                     max_length=255,
                     null=True,
                     verbose_name='API Client ID')),
                ('client_secret',
                 models.CharField(
                     help_text=
                     'The API Client Secret provided to edX by the enterprise customer to be used to make  API calls to Canvas on behalf of the customer.',
                     max_length=255,
                     null=True,
                     verbose_name='API Client Secret')),
                ('canvas_account_id',
                 models.IntegerField(
                     help_text=
                     'Account number to use during api calls. Called account_id in canvas.  Required to create courses etc.',
                     null=True,
                     verbose_name='Canvas Account Number')),
                ('canvas_base_url',
                 models.CharField(
                     help_text=
                     'The base URL used for API requests to Canvas, i.e. https://instructure.com.',
                     max_length=255,
                     null=True,
                     verbose_name='Canvas Base URL')),
                ('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)),
                ('enterprise_customer',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     help_text=
                     'Enterprise Customer associated with the configuration.',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='enterprise.EnterpriseCustomer')),
                ('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 canvas enterprise customer configuration',
                'get_latest_by': 'history_date',
                'ordering': ('-history_date', '-history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='CanvasGlobalConfiguration',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('change_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Change date')),
                ('enabled',
                 models.BooleanField(default=False, verbose_name='Enabled')),
                ('course_api_path',
                 models.CharField(
                     help_text=
                     'The API path for making course metadata POST/DELETE requests to Canvas.',
                     max_length=255,
                     verbose_name='Course Metadata API Path')),
                ('changed_by',
                 models.ForeignKey(editable=False,
                                   null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Changed by')),
            ],
        ),
        migrations.CreateModel(
            name='CanvasEnterpriseCustomerConfiguration',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('active',
                 models.BooleanField(
                     help_text='Is this configuration active?')),
                ('transmission_chunk_size',
                 models.IntegerField(
                     default=500,
                     help_text=
                     'The maximum number of data items to transmit to the integrated channel with each request.'
                 )),
                ('channel_worker_username',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Enterprise channel worker username to get JWT tokens for authenticating LMS APIs.',
                     max_length=255,
                     null=True)),
                ('catalogs_to_transmit',
                 models.TextField(
                     blank=True,
                     help_text=
                     'A comma-separated list of catalog UUIDs to transmit.',
                     null=True)),
                ('client_id',
                 models.CharField(
                     help_text=
                     'The API Client ID provided to edX by the enterprise customer to be used to make API calls to Canvas on behalf of the customer.',
                     max_length=255,
                     null=True,
                     verbose_name='API Client ID')),
                ('client_secret',
                 models.CharField(
                     help_text=
                     'The API Client Secret provided to edX by the enterprise customer to be used to make  API calls to Canvas on behalf of the customer.',
                     max_length=255,
                     null=True,
                     verbose_name='API Client Secret')),
                ('canvas_account_id',
                 models.IntegerField(
                     help_text=
                     'Account number to use during api calls. Called account_id in canvas.  Required to create courses etc.',
                     null=True,
                     verbose_name='Canvas Account Number')),
                ('canvas_base_url',
                 models.CharField(
                     help_text=
                     'The base URL used for API requests to Canvas, i.e. https://instructure.com.',
                     max_length=255,
                     null=True,
                     verbose_name='Canvas Base URL')),
                ('enterprise_customer',
                 models.OneToOneField(
                     help_text=
                     'Enterprise Customer associated with the configuration.',
                     on_delete=django.db.models.deletion.CASCADE,
                     to='enterprise.EnterpriseCustomer')),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('courses', '0010_migrate_partner_data_to_courses'),
        ('catalogue', '0038_coupon_enterprise_id_attribute'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalProduct',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('structure', models.CharField(choices=[(b'standalone', 'Stand-alone product'), (b'parent', 'Parent product'), (b'child', 'Child product')], default=b'standalone', max_length=10, verbose_name='Product structure')),
                ('upc', oscar.models.fields.NullCharField(db_index=True, help_text='Universal Product Code (UPC) is an identifier for a product which is not specific to a particular  supplier. Eg an ISBN for a book.', max_length=64, verbose_name='UPC')),
                ('title', models.CharField(blank=True, max_length=255, verbose_name='Title')),
                ('slug', models.SlugField(max_length=255, verbose_name='Slug')),
                ('description', models.TextField(blank=True, verbose_name='Description')),
                ('rating', models.FloatField(editable=False, null=True, verbose_name='Rating')),
                ('date_created', models.DateTimeField(blank=True, editable=False, verbose_name='Date created')),
                ('date_updated', models.DateTimeField(blank=True, db_index=True, editable=False, verbose_name='Date updated')),
                ('is_discountable', models.BooleanField(default=True, help_text='This flag indicates if this product can be used in an offer or not', verbose_name='Is discountable?')),
                ('expires', models.DateTimeField(blank=True, help_text='Last date/time on which this product can be purchased.', 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)),
                ('course', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='courses.Course')),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('parent', models.ForeignKey(blank=True, db_constraint=False, help_text="Only choose a parent product if you're creating a child product.  For example if this is a size 4 of a particular t-shirt.  Leave blank if this is a stand-alone product (i.e. there is only one version of this product).", null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='catalogue.Product', verbose_name='Parent product')),
                ('product_class', models.ForeignKey(blank=True, db_constraint=False, help_text='Choose what type of product this is', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='catalogue.ProductClass', verbose_name='Product type')),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical Product',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalProductAttributeValue',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('value_text', models.TextField(blank=True, null=True, verbose_name='Text')),
                ('value_integer', models.IntegerField(blank=True, null=True, verbose_name='Integer')),
                ('value_boolean', models.NullBooleanField(verbose_name='Boolean')),
                ('value_float', models.FloatField(blank=True, null=True, verbose_name='Float')),
                ('value_richtext', models.TextField(blank=True, null=True, verbose_name='Richtext')),
                ('value_date', models.DateField(blank=True, null=True, verbose_name='Date')),
                ('value_datetime', models.DateTimeField(blank=True, null=True, verbose_name='DateTime')),
                ('value_file', models.TextField(blank=True, max_length=255, null=True)),
                ('value_image', models.TextField(blank=True, max_length=255, null=True)),
                ('entity_object_id', models.PositiveIntegerField(blank=True, editable=False, 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)),
                ('attribute', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='catalogue.ProductAttribute', verbose_name='Attribute')),
                ('entity_content_type', models.ForeignKey(blank=True, db_constraint=False, editable=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='contenttypes.ContentType')),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('product', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='catalogue.Product', verbose_name='Product')),
                ('value_option', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='catalogue.AttributeOption', verbose_name='Value option')),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical Product attribute value',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Пример #22
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AttributeType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=128, unique=True)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='HistoricalResource',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(db_index=True, max_length=128)),
                ('description', models.TextField()),
                ('is_available', models.BooleanField(default=True)),
                ('is_public', models.BooleanField(default=True)),
                ('is_subscribable', models.BooleanField(default=True)),
                ('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={
                'get_latest_by': 'history_date',
                'verbose_name': 'historical resource',
                'ordering': ('-history_date', '-history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalResourceAttribute',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('value', models.CharField(max_length=512)),
                ('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={
                'get_latest_by': 'history_date',
                'verbose_name': 'historical resource attribute',
                'ordering': ('-history_date', '-history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalResourceAttributeType',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=128)),
                ('is_required', models.BooleanField(default=False)),
                ('is_unique_per_resource', models.BooleanField(default=False)),
                ('is_value_unique', models.BooleanField(default=False)),
                ('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)),
                ('attribute_type', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='resources.AttributeType')),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'get_latest_by': 'history_date',
                'verbose_name': 'historical resource attribute type',
                'ordering': ('-history_date', '-history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalResourceType',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(db_index=True, max_length=128)),
                ('description', models.CharField(max_length=255)),
                ('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={
                'get_latest_by': 'history_date',
                'verbose_name': 'historical resource type',
                'ordering': ('-history_date', '-history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='Resource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=128, unique=True)),
                ('description', models.TextField()),
                ('is_available', models.BooleanField(default=True)),
                ('is_public', models.BooleanField(default=True)),
                ('is_subscribable', models.BooleanField(default=True)),
                ('allowed_groups', models.ManyToManyField(blank=True, to='auth.Group')),
                ('allowed_users', models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL)),
                ('linked_resources', models.ManyToManyField(blank=True, related_name='_resource_linked_resources_+', to='resources.Resource')),
                ('parent_resource', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='resources.Resource')),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='ResourceAttribute',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('value', models.CharField(max_length=512)),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resources.Resource')),
            ],
        ),
        migrations.CreateModel(
            name='ResourceAttributeType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=128)),
                ('is_required', models.BooleanField(default=False)),
                ('is_unique_per_resource', models.BooleanField(default=False)),
                ('is_value_unique', models.BooleanField(default=False)),
                ('attribute_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resources.AttributeType')),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='ResourceType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=128, unique=True)),
                ('description', models.CharField(max_length=255)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.AddField(
            model_name='resourceattribute',
            name='resource_attribute_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resources.ResourceAttributeType'),
        ),
        migrations.AddField(
            model_name='resource',
            name='resource_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resources.ResourceType'),
        ),
        migrations.AddField(
            model_name='historicalresourceattribute',
            name='resource',
            field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='resources.Resource'),
        ),
        migrations.AddField(
            model_name='historicalresourceattribute',
            name='resource_attribute_type',
            field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='resources.ResourceAttributeType'),
        ),
        migrations.AddField(
            model_name='historicalresource',
            name='parent_resource',
            field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='resources.Resource'),
        ),
        migrations.AddField(
            model_name='historicalresource',
            name='resource_type',
            field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='resources.ResourceType'),
        ),
        migrations.AlterUniqueTogether(
            name='resourceattribute',
            unique_together={('resource_attribute_type', 'resource')},
        ),
    ]
Пример #23
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("contenttypes", "0002_remove_content_type_name"),
        ("content", "0013_auto_20210216_0946"),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalTheme",
            fields=[
                (
                    "id",
                    models.IntegerField(auto_created=True,
                                        blank=True,
                                        db_index=True,
                                        verbose_name="ID"),
                ),
                ("title", models.CharField(max_length=255)),
                ("slug", models.SlugField(max_length=255)),
                ("summary", models.CharField(max_length=255)),
                ("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 theme",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalSiteAlertBanner",
            fields=[
                (
                    "id",
                    models.IntegerField(auto_created=True,
                                        blank=True,
                                        db_index=True,
                                        verbose_name="ID"),
                ),
                ("banner_text", models.CharField(max_length=255)),
                ("activated", models.BooleanField(default=False)),
                ("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 site alert banner",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalSearchPinPageLookUp",
            fields=[
                (
                    "id",
                    models.IntegerField(auto_created=True,
                                        blank=True,
                                        db_index=True,
                                        verbose_name="ID"),
                ),
                ("object_id", models.PositiveIntegerField()),
                ("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,
                    ),
                ),
                (
                    "content_type",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="contenttypes.contenttype",
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "search_keyword_or_phrase",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="content.searchkeywordorphrase",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical search pin page look up",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalSearchKeywordOrPhrase",
            fields=[
                (
                    "id",
                    models.IntegerField(auto_created=True,
                                        blank=True,
                                        db_index=True,
                                        verbose_name="ID"),
                ),
                ("keyword_or_phrase", models.CharField(max_length=1000)),
                ("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 search keyword or phrase",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalSearchExclusionPageLookUp",
            fields=[
                (
                    "id",
                    models.IntegerField(auto_created=True,
                                        blank=True,
                                        db_index=True,
                                        verbose_name="ID"),
                ),
                ("object_id", models.PositiveIntegerField()),
                ("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,
                    ),
                ),
                (
                    "content_type",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="contenttypes.contenttype",
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "search_keyword_or_phrase",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="content.searchkeywordorphrase",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical search exclusion page look up",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("shopify_sync", "0010_auto_20200819_1929"),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalVariant",
            fields=[
                ("id", models.BigIntegerField(db_index=True)),
                ("admin_graphql_api_id", models.CharField(max_length=80)),
                ("created_at", models.DateTimeField(null=True)),
                ("updated_at", models.DateTimeField(null=True)),
                ("barcode", models.CharField(max_length=255, null=True)),
                (
                    "compare_at_price",
                    models.DecimalField(decimal_places=2, max_digits=10, null=True),
                ),
                (
                    "fulfillment_service",
                    models.CharField(default="manual", max_length=32),
                ),
                ("grams", models.IntegerField()),
                (
                    "inventory_management",
                    models.CharField(default="blank", max_length=32, null=True),
                ),
                (
                    "inventory_policy",
                    models.CharField(default="deny", max_length=32, null=True),
                ),
                ("inventory_quantity", models.IntegerField(null=True)),
                ("option1", models.CharField(max_length=255, null=True)),
                ("option2", models.CharField(max_length=255, null=True)),
                ("option3", models.CharField(max_length=255, null=True)),
                ("position", models.IntegerField(default=1, null=True)),
                ("price", models.DecimalField(decimal_places=2, max_digits=10)),
                ("requires_shipping", models.BooleanField(default=True)),
                ("sku", models.CharField(max_length=255, null=True)),
                ("taxable", models.BooleanField(default=True)),
                ("title", models.CharField(blank=True, max_length=255, 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,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "product",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="shopify_sync.product",
                    ),
                ),
                (
                    "session",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="shopify_sync.session",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical variant",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalProduct",
            fields=[
                ("id", models.BigIntegerField(db_index=True)),
                ("admin_graphql_api_id", models.CharField(max_length=80)),
                ("created_at", models.DateTimeField(null=True)),
                ("updated_at", models.DateTimeField(null=True)),
                ("body_html", models.TextField(default="", null=True)),
                ("handle", models.CharField(db_index=True, max_length=255)),
                ("product_type", models.CharField(db_index=True, max_length=255)),
                ("published_at", models.DateTimeField(null=True)),
                ("published_scope", models.CharField(default="global", max_length=64)),
                ("tags", models.CharField(blank=True, max_length=255)),
                ("template_suffix", models.CharField(max_length=255, null=True)),
                ("title", models.CharField(db_index=True, max_length=255)),
                ("vendor", models.CharField(db_index=True, max_length=255, 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,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "session",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="shopify_sync.session",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical product",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Пример #25
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalDocPage",
            fields=[
                (
                    "id",
                    models.IntegerField(
                        auto_created=True,
                        blank=True,
                        db_index=True,
                        verbose_name="ID",
                    ),
                ),
                ("created", models.DateTimeField(blank=True, editable=False)),
                ("modified", models.DateTimeField(blank=True, editable=False)),
                ("title", models.CharField(max_length=1024)),
                (
                    "slug",
                    django_extensions.db.fields.AutoSlugField(
                        blank=True,
                        editable=False,
                        max_length=1024,
                        populate_from="title",
                    ),
                ),
                ("content", models.TextField()),
                (
                    "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 doc page",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="DocPage",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("modified", models.DateTimeField(auto_now=True)),
                ("title", models.CharField(max_length=1024)),
                (
                    "slug",
                    django_extensions.db.fields.AutoSlugField(
                        blank=True,
                        editable=False,
                        max_length=1024,
                        populate_from="title",
                    ),
                ),
                ("content", models.TextField()),
                (
                    "order",
                    models.IntegerField(
                        default=1,
                        editable=False,
                        help_text=
                        "Determines order in which pages appear in side menu",
                    ),
                ),
                (
                    "parent",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="children",
                        to="documentation.docpage",
                    ),
                ),
            ],
            options={"ordering": ["order"]},
        ),
    ]
Пример #26
0
class Migration(migrations.Migration):
    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('catalog', '0005_enterprisecatalog_addtl_fields'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalContentMetadata',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('content_key',
                 models.CharField(
                     db_index=True,
                     help_text=
                     'The key that represents a piece of content, such as a course, course run, or program.',
                     max_length=255)),
                ('content_type',
                 models.CharField(choices=[('course', 'Course'),
                                           ('course_run', 'Course Run'),
                                           ('program', 'Program')],
                                  max_length=255)),
                ('parent_content_key',
                 models.CharField(
                     blank=True,
                     db_index=True,
                     help_text=
                     "The key that represents this content's parent, such as a course or program.",
                     max_length=255,
                     null=True)),
                ('json_metadata',
                 jsonfield.fields.JSONField(
                     blank=True,
                     default={},
                     help_text=
                     "The metadata about a particular piece content as retrieved from the discovery service's search/all endpoint results, specified as a JSON object.",
                     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)),
                ('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 Content Metadata',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.AlterField(
            model_name='catalogquery',
            name='title',
            field=models.CharField(max_length=255, unique=True),
        ),
        migrations.AlterField(
            model_name='contentmetadata',
            name='content_type',
            field=models.CharField(choices=[('course', 'Course'),
                                            ('course_run', 'Course Run'),
                                            ('program', 'Program')],
                                   max_length=255),
        ),
        migrations.AlterField(
            model_name='contentmetadata',
            name='parent_content_key',
            field=models.CharField(
                blank=True,
                db_index=True,
                help_text=
                "The key that represents this content's parent, such as a course or program.",
                max_length=255,
                null=True),
        ),
        migrations.AlterField(
            model_name='enterprisecatalog',
            name='title',
            field=models.CharField(max_length=255),
        ),
        migrations.AlterField(
            model_name='historicalenterprisecatalog',
            name='title',
            field=models.CharField(max_length=255),
        ),
        migrations.AlterUniqueTogether(
            name='enterprisecatalog',
            unique_together={('enterprise_uuid', 'catalog_query')},
        ),
    ]
Пример #27
0
class Migration(migrations.Migration):
    initial = True

    dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]

    operations = [
        migrations.CreateModel(
            name="Post",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("modified", models.DateTimeField(auto_now=True)),
                ("title", models.CharField(max_length=1024)),
                (
                    "slug",
                    django_extensions.db.fields.AutoSlugField(
                        blank=True,
                        editable=False,
                        max_length=1024,
                        populate_from="title",
                    ),
                ),
                ("description", models.TextField()),
                ("content", models.TextField()),
                (
                    "logo",
                    models.ImageField(
                        storage=grandchallenge.core.storage.PublicS3Storage(),
                        upload_to=grandchallenge.core.storage.get_logo_path,
                    ),
                ),
                ("published", models.BooleanField(default=False)),
                (
                    "authors",
                    models.ManyToManyField(to=settings.AUTH_USER_MODEL),
                ),
            ],
            options={"ordering": ("-created", )},
        ),
        migrations.CreateModel(
            name="HistoricalPost",
            fields=[
                (
                    "id",
                    models.IntegerField(
                        auto_created=True,
                        blank=True,
                        db_index=True,
                        verbose_name="ID",
                    ),
                ),
                ("created", models.DateTimeField(blank=True, editable=False)),
                ("modified", models.DateTimeField(blank=True, editable=False)),
                ("title", models.CharField(max_length=1024)),
                (
                    "slug",
                    django_extensions.db.fields.AutoSlugField(
                        blank=True,
                        editable=False,
                        max_length=1024,
                        populate_from="title",
                    ),
                ),
                ("description", models.TextField()),
                ("content", models.TextField()),
                ("logo", models.TextField(max_length=100)),
                ("published", models.BooleanField(default=False)),
                (
                    "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 post",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Пример #28
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('adserver', '0054_add_payout_status_dates'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalPublisherPayout',
            fields=[
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='created')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modified')),
                ('id',
                 models.UUIDField(db_index=True,
                                  default=uuid.uuid4,
                                  editable=False)),
                ('amount',
                 models.DecimalField(decimal_places=2,
                                     default=0,
                                     max_digits=8,
                                     verbose_name='Amount')),
                ('date', models.DateTimeField(verbose_name='Payout date')),
                ('method',
                 models.CharField(blank=True,
                                  choices=[
                                      ('stripe',
                                       'Stripe (Bank transfer, debit card)'),
                                      ('paypal', 'PayPal'),
                                      ('opencollective', 'Open Collective'),
                                      ('other', 'Other')
                                  ],
                                  default=None,
                                  max_length=100,
                                  null=True)),
                ('note',
                 models.TextField(
                     blank=True,
                     help_text='A publisher-visible note about the payout',
                     null=True,
                     verbose_name='Note')),
                ('attachment',
                 models.TextField(
                     blank=True,
                     help_text=
                     'A publisher-visible attachment such as a receipt',
                     max_length=255,
                     null=True,
                     verbose_name='Attachment')),
                ('start_date',
                 models.DateField(help_text='First day of paid period',
                                  null=True,
                                  verbose_name='Start Date')),
                ('end_date',
                 models.DateField(help_text='Last day of paid period',
                                  null=True,
                                  verbose_name='End Date')),
                ('status',
                 models.CharField(choices=[('pending', 'Pending'),
                                           ('hold', 'On hold'),
                                           ('emailed', 'Email sent'),
                                           ('paid', 'Payment sent')],
                                  default='pending',
                                  help_text='Status of this payout',
                                  max_length=50)),
                ('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)),
                ('publisher',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='adserver.Publisher')),
            ],
            options={
                'verbose_name': 'historical publisher payout',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalPublisherGroup',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='created')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modified')),
                ('name',
                 models.CharField(help_text='Visible to advertisers',
                                  max_length=200,
                                  verbose_name='Name')),
                ('slug',
                 models.SlugField(max_length=200,
                                  verbose_name='Publisher group slug')),
                ('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 publisher group',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalPublisher',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='created')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modified')),
                ('name', models.CharField(max_length=200,
                                          verbose_name='Name')),
                ('slug',
                 models.SlugField(max_length=200,
                                  verbose_name='Publisher Slug')),
                ('revenue_share_percentage',
                 models.FloatField(
                     default=70.0,
                     help_text=
                     'Percentage of advertising revenue shared with this publisher',
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(100)
                     ])),
                ('default_keywords',
                 models.CharField(
                     blank=True,
                     default='',
                     help_text=
                     'A CSV of default keywords for this property. Used for targeting.',
                     max_length=250,
                     verbose_name='Default keywords')),
                ('unauthed_ad_decisions',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Whether this publisher allows unauthenticated ad decision API requests (eg. JSONP)'
                 )),
                ('allow_paid_campaigns',
                 models.BooleanField(default=False,
                                     verbose_name='Allow paid campaigns')),
                ('allow_affiliate_campaigns',
                 models.BooleanField(
                     default=False, verbose_name='Allow affiliate campaigns')),
                ('allow_community_campaigns',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'These are unpaid campaigns that support non-profit projects in our community. Shown only when no paid ads are available',
                     verbose_name='Allow community campaigns')),
                ('allow_house_campaigns',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'These are ads for EthicalAds itself. Shown only when no paid ads are available.',
                     verbose_name='Allow house campaigns')),
                ('payout_method',
                 models.CharField(blank=True,
                                  choices=[
                                      ('stripe',
                                       'Stripe (Bank transfer, debit card)'),
                                      ('paypal', 'PayPal'),
                                      ('opencollective', 'Open Collective'),
                                      ('other', 'Other')
                                  ],
                                  default=None,
                                  max_length=100,
                                  null=True)),
                ('stripe_connected_account_id',
                 models.CharField(blank=True,
                                  default=None,
                                  max_length=200,
                                  null=True,
                                  verbose_name='Stripe connected account ID')),
                ('open_collective_name',
                 models.CharField(blank=True,
                                  default=None,
                                  max_length=200,
                                  null=True,
                                  verbose_name='Open Collective name')),
                ('paypal_email',
                 models.EmailField(blank=True,
                                   default=None,
                                   max_length=254,
                                   null=True,
                                   verbose_name='PayPal email address')),
                ('record_views',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Record each ad view from this publisher to the database')
                 ),
                ('record_placements',
                 models.BooleanField(
                     default=False,
                     help_text='Record placement impressions for this publisher'
                 )),
                ('render_pixel',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Render ethical-pixel in ad templates. This is needed for users not using the ad client.'
                 )),
                ('sampled_ctr',
                 models.FloatField(
                     default=0.0,
                     help_text=
                     'A periodically calculated CTR from a sample of ads on this publisher.'
                 )),
                ('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 publisher',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalFlight',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='created')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modified')),
                ('name', models.CharField(max_length=200,
                                          verbose_name='Name')),
                ('slug',
                 models.SlugField(max_length=200, verbose_name='Flight Slug')),
                ('start_date',
                 models.DateField(
                     db_index=True,
                     default=datetime.date.today,
                     help_text='This ad will not be shown before this date',
                     verbose_name='Start Date')),
                ('end_date',
                 models.DateField(
                     default=adserver.models.default_flight_end_date,
                     help_text=
                     'The target end date for the ad (it may go after this date)',
                     verbose_name='End Date')),
                ('live', models.BooleanField(default=False,
                                             verbose_name='Live')),
                ('priority_multiplier',
                 models.IntegerField(
                     default=1,
                     help_text=
                     "Multiplies chance of showing this flight's ads [1,1000000]",
                     validators=[
                         django.core.validators.MinValueValidator(1),
                         django.core.validators.MaxValueValidator(1000000)
                     ],
                     verbose_name='Priority Multiplier')),
                ('cpc',
                 models.DecimalField(decimal_places=2,
                                     default=0,
                                     max_digits=5,
                                     verbose_name='Cost Per Click')),
                ('sold_clicks',
                 models.PositiveIntegerField(default=0,
                                             verbose_name='Sold Clicks')),
                ('cpm',
                 models.DecimalField(decimal_places=2,
                                     default=0,
                                     max_digits=5,
                                     verbose_name='Cost Per 1k Impressions')),
                ('sold_impressions',
                 models.PositiveIntegerField(default=0,
                                             verbose_name='Sold Impressions')),
                ('targeting_parameters',
                 jsonfield.fields.JSONField(
                     blank=True,
                     null=True,
                     validators=[
                         adserver.validators.TargetingParametersValidator()
                     ],
                     verbose_name='Targeting parameters')),
                ('total_views',
                 models.PositiveIntegerField(
                     default=0,
                     help_text='Views across all ads in this flight')),
                ('total_clicks',
                 models.PositiveIntegerField(
                     default=0,
                     help_text='Clicks across all ads in this flight')),
                ('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)),
                ('campaign',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='adserver.Campaign')),
                ('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 flight',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalCampaign',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='created')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modified')),
                ('name', models.CharField(max_length=200,
                                          verbose_name='Name')),
                ('slug',
                 models.SlugField(max_length=200,
                                  verbose_name='Campaign Slug')),
                ('campaign_type',
                 models.CharField(
                     choices=[('paid', 'Paid'), ('affiliate', 'Affiliate'),
                              ('community',
                               'Community'), ('house', 'House')],
                     default='paid',
                     help_text=
                     'Most campaigns are paid but ad server admins can configure other lower priority campaign types.',
                     max_length=20,
                     verbose_name='Campaign Type')),
                ('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)),
                ('advertiser',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     help_text='The advertiser for this campaign.',
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='adserver.Advertiser')),
                ('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 campaign',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalAdvertiser',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='created')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modified')),
                ('name', models.CharField(max_length=200,
                                          verbose_name='Name')),
                ('slug',
                 models.SlugField(max_length=200,
                                  verbose_name='Advertiser Slug')),
                ('stripe_customer_id',
                 models.CharField(blank=True,
                                  default=None,
                                  max_length=200,
                                  null=True,
                                  verbose_name='Stripe Customer ID')),
                ('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 advertiser',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalAdvertisement',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='created')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modified')),
                ('name', models.CharField(max_length=200,
                                          verbose_name='Name')),
                ('slug', models.SlugField(max_length=200,
                                          verbose_name='Slug')),
                ('text',
                 models.TextField(
                     blank=True,
                     help_text=
                     'For most ad types, the text should be less than 100 characters.',
                     verbose_name='Text')),
                ('headline',
                 models.CharField(
                     blank=True,
                     help_text=
                     'An optional headline at the beginning of the ad usually displayed in bold',
                     max_length=200,
                     null=True)),
                ('content',
                 models.TextField(
                     blank=True,
                     help_text=
                     'For most ad types, the combined length of the headline, body, and call to action should be less than 100 characters.',
                     null=True)),
                ('cta',
                 models.CharField(
                     blank=True,
                     help_text=
                     'An optional call to action displayed at the end of the ad usually in bold',
                     max_length=200,
                     null=True,
                     verbose_name='Call to action')),
                ('link',
                 models.URLField(
                     help_text=
                     "URL of your landing page. This may contain UTM parameters so you know the traffic came from us. The publisher will be added in the 'ea-publisher' query parameter.",
                     max_length=255,
                     verbose_name='Link URL')),
                ('image',
                 models.TextField(blank=True,
                                  help_text='Sized according to the ad type',
                                  max_length=255,
                                  null=True,
                                  verbose_name='Image')),
                ('live', models.BooleanField(default=False,
                                             verbose_name='Live')),
                ('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)),
                ('ad_type',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     default=None,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='adserver.AdType')),
                ('flight',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='adserver.Flight')),
                ('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 advertisement',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalAdType',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 django_extensions.db.fields.CreationDateTimeField(
                     auto_now_add=True, verbose_name='created')),
                ('modified',
                 django_extensions.db.fields.ModificationDateTimeField(
                     auto_now=True, verbose_name='modified')),
                ('name', models.CharField(max_length=200,
                                          verbose_name='Name')),
                ('slug', models.SlugField(max_length=200,
                                          verbose_name='Slug')),
                ('has_image',
                 models.BooleanField(default=True, verbose_name='Has image?')),
                ('image_width',
                 models.PositiveIntegerField(blank=True, null=True)),
                ('image_height',
                 models.PositiveIntegerField(blank=True, null=True)),
                ('has_text',
                 models.BooleanField(default=True, verbose_name='Has text?')),
                ('max_text_length',
                 models.PositiveIntegerField(
                     blank=True,
                     help_text='Max length does not include HTML tags',
                     null=True)),
                ('allowed_html_tags',
                 models.CharField(
                     blank=True,
                     default='a b strong i em code',
                     help_text='Space separated list of allowed HTML tag names',
                     max_length=255,
                     verbose_name='Allowed HTML tags')),
                ('default_enabled',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Whether this ad type should default to checked when advertisers are creating ads'
                 )),
                ('template',
                 models.TextField(
                     blank=True,
                     help_text=
                     'Override the template for rendering this ad type',
                     null=True,
                     verbose_name='Ad template')),
                ('description',
                 models.CharField(
                     blank=True,
                     default='',
                     help_text=
                     'A short description of the ad type to guide advertisers.',
                     max_length=255)),
                ('order', models.PositiveSmallIntegerField(default=0)),
                ('deprecated',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Users cannot select deprecated ad types unless an ad is already that type.'
                 )),
                ('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 ad type',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Пример #29
0
class Migration(migrations.Migration):

    dependencies = [
        ("user", "0003_user_legacy_sso_user_id"),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalUser",
            fields=[
                (
                    "id",
                    models.IntegerField(
                        auto_created=True, blank=True, db_index=True, verbose_name="ID"
                    ),
                ),
                ("password", models.CharField(max_length=128, verbose_name="password")),
                (
                    "last_login",
                    models.DateTimeField(
                        blank=True, null=True, verbose_name="last login"
                    ),
                ),
                (
                    "is_superuser",
                    models.BooleanField(
                        default=False,
                        help_text="Designates that this user has all permissions without explicitly assigning them.",
                        verbose_name="superuser status",
                    ),
                ),
                (
                    "username",
                    models.CharField(
                        db_index=True,
                        error_messages={
                            "unique": "A user with that username already exists."
                        },
                        help_text="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
                        max_length=150,
                        validators=[
                            django.contrib.auth.validators.UnicodeUsernameValidator()
                        ],
                        verbose_name="username",
                    ),
                ),
                (
                    "first_name",
                    models.CharField(
                        blank=True, max_length=150, verbose_name="first name"
                    ),
                ),
                (
                    "last_name",
                    models.CharField(
                        blank=True, max_length=150, verbose_name="last name"
                    ),
                ),
                (
                    "email",
                    models.EmailField(
                        blank=True, max_length=254, verbose_name="email address"
                    ),
                ),
                (
                    "is_staff",
                    models.BooleanField(
                        default=False,
                        help_text="Designates whether the user can log into this admin site.",
                        verbose_name="staff status",
                    ),
                ),
                (
                    "is_active",
                    models.BooleanField(
                        default=True,
                        help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
                        verbose_name="active",
                    ),
                ),
                (
                    "date_joined",
                    models.DateTimeField(
                        default=django.utils.timezone.now, verbose_name="date joined"
                    ),
                ),
                (
                    "sso_contact_email",
                    models.EmailField(blank=True, max_length=254, null=True),
                ),
                (
                    "legacy_sso_user_id",
                    models.CharField(blank=True, max_length=255, 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,
                    ),
                ),
                (
                    "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 user",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Пример #30
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='HistoricalPublication',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('title', models.CharField(max_length=1024)),
                ('author', models.CharField(max_length=1024)),
                ('year', models.PositiveIntegerField()),
                ('unique_id',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('status',
                 models.CharField(choices=[('Active', 'Active'),
                                           ('Archived', 'Archived')],
                                  default='Active',
                                  max_length=16)),
                ('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)),
                ('project',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='project.Project')),
            ],
            options={
                'get_latest_by': 'history_date',
                'verbose_name': 'historical publication',
                'ordering': ('-history_date', '-history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='Publication',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('title', models.CharField(max_length=1024)),
                ('author', models.CharField(max_length=1024)),
                ('year', models.PositiveIntegerField()),
                ('unique_id',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('status',
                 models.CharField(choices=[('Active', 'Active'),
                                           ('Archived', 'Archived')],
                                  default='Active',
                                  max_length=16)),
                ('project',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='project.Project')),
            ],
        ),
        migrations.CreateModel(
            name='PublicationSource',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created',
                 model_utils.fields.AutoCreatedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='created')),
                ('modified',
                 model_utils.fields.AutoLastModifiedField(
                     default=django.utils.timezone.now,
                     editable=False,
                     verbose_name='modified')),
                ('name', models.CharField(max_length=255)),
                ('url', models.URLField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='publication',
            name='source',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='publication.PublicationSource'),
        ),
        migrations.AddField(
            model_name='historicalpublication',
            name='source',
            field=models.ForeignKey(
                blank=True,
                db_constraint=False,
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name='+',
                to='publication.PublicationSource'),
        ),
        migrations.AlterUniqueTogether(
            name='publication',
            unique_together={('project', 'unique_id')},
        ),
    ]