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),
        ),
    ]
Exemple #2
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),
        ),
    ]
Exemple #3
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),
        ),
    ]
Exemple #4
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),
        ),
    ]
Exemple #5
0
class Migration(migrations.Migration):
    dependencies = [
        ('accounts', '0007_auto_20190827_0214'),
    ]

    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=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('email', models.EmailField(db_index=True, max_length=254)),
                ('address', models.CharField(max_length=150, null=True)),
                ('country',
                 django_countries.fields.CountryField(max_length=2)),
                ('city', models.CharField(max_length=50, null=True)),
                ('phone', models.CharField(max_length=12, null=True)),
                ('mobile', models.CharField(max_length=12, null=True)),
                ('is_active',
                 models.BooleanField(default=True,
                                     verbose_name='active status')),
                ('is_student',
                 models.BooleanField(default=False,
                                     verbose_name='student status')),
                ('is_teacher',
                 models.BooleanField(default=False,
                                     verbose_name='teacher status')),
                ('is_school',
                 models.BooleanField(default=False,
                                     verbose_name='school status')),
                ('is_curator',
                 models.BooleanField(default=False,
                                     verbose_name='curator status')),
                ('is_editor',
                 models.BooleanField(default=False,
                                     verbose_name='editor status')),
                ('is_marketer',
                 models.BooleanField(default=False,
                                     verbose_name='marketer status')),
                ('account_type',
                 models.CharField(choices=[('student', 'SchoolStudent'),
                                           ('teacher', 'Teacher'),
                                           ('school', 'School'),
                                           ('curator', 'Curator'),
                                           ('editor', 'Editor'),
                                           ('super admin', 'Super Admin'),
                                           ('admin', 'Admin')],
                                  max_length=11,
                                  verbose_name='Account 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 user',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalSuperAdmin',
            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)),
                ('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 super admin',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalStudent',
            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)),
                ('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 student',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalGrade',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('slug', models.SlugField(editable=False, max_length=200)),
                ('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 class',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalEditor',
            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)),
                ('admin',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='accounts.SuperAdmin')),
                ('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 editor',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalCurator',
            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)),
                ('admin',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='accounts.SuperAdmin')),
                ('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 curator',
                '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),
        ('enterprise', '0110_add_default_contract_discount'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalPendingEnterpriseCustomerAdminUser',
            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')),
                ('user_email', models.EmailField(max_length=254)),
                ('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,
                     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={
                'get_latest_by': 'history_date',
                'verbose_name':
                'historical pending enterprise customer admin user',
                'ordering': ('-history_date', '-history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='PendingEnterpriseCustomerAdminUser',
            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')),
                ('user_email', models.EmailField(max_length=254)),
                ('enterprise_customer',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='enterprise.EnterpriseCustomer')),
            ],
            options={
                'unique_together': {('enterprise_customer', 'user_email')},
                'ordering': ['created'],
            },
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('catalogue',
         '0039_historicalproduct_historicalproductattributevalue'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('basket', '0011_add_email_basket_attribute_type'),
        ('sites', '0002_alter_domain_unique'),
        ('partner', '0014_historicalstockrecord'),
        ('order', '0017_order_partner'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalLine',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('partner_name',
                 models.CharField(blank=True,
                                  max_length=128,
                                  verbose_name='Partner name')),
                ('partner_sku',
                 models.CharField(max_length=128, verbose_name='Partner SKU')),
                ('partner_line_reference',
                 models.CharField(
                     blank=True,
                     help_text=
                     'This is the item number that the partner uses within their system',
                     max_length=128,
                     verbose_name='Partner reference')),
                ('partner_line_notes',
                 models.TextField(blank=True, verbose_name='Partner Notes')),
                ('title', models.CharField(max_length=255,
                                           verbose_name='Title')),
                ('upc',
                 models.CharField(blank=True,
                                  max_length=128,
                                  null=True,
                                  verbose_name='UPC')),
                ('quantity',
                 models.PositiveIntegerField(default=1,
                                             verbose_name='Quantity')),
                ('line_price_incl_tax',
                 models.DecimalField(decimal_places=2,
                                     max_digits=12,
                                     verbose_name='Price (inc. tax)')),
                ('line_price_excl_tax',
                 models.DecimalField(decimal_places=2,
                                     max_digits=12,
                                     verbose_name='Price (excl. tax)')),
                ('line_price_before_discounts_incl_tax',
                 models.DecimalField(
                     decimal_places=2,
                     max_digits=12,
                     verbose_name='Price before discounts (inc. tax)')),
                ('line_price_before_discounts_excl_tax',
                 models.DecimalField(
                     decimal_places=2,
                     max_digits=12,
                     verbose_name='Price before discounts (excl. tax)')),
                ('unit_cost_price',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     max_digits=12,
                                     null=True,
                                     verbose_name='Unit Cost Price')),
                ('unit_price_incl_tax',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     max_digits=12,
                                     null=True,
                                     verbose_name='Unit Price (inc. tax)')),
                ('unit_price_excl_tax',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     max_digits=12,
                                     null=True,
                                     verbose_name='Unit Price (excl. tax)')),
                ('unit_retail_price',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     max_digits=12,
                                     null=True,
                                     verbose_name='Unit Retail Price')),
                ('status',
                 models.CharField(blank=True,
                                  max_length=255,
                                  verbose_name='Status')),
                ('est_dispatch_date',
                 models.DateField(blank=True,
                                  null=True,
                                  verbose_name='Estimated Dispatch 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)),
                ('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')),
                ('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')),
                ('stockrecord',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='partner.StockRecord',
                     verbose_name='Stock record')),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical Order Line',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalOrder',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('number',
                 models.CharField(db_index=True,
                                  max_length=128,
                                  verbose_name='Order number')),
                ('currency',
                 models.CharField(
                     default=oscar.core.utils.get_default_currency,
                     max_length=12,
                     verbose_name='Currency')),
                ('total_incl_tax',
                 models.DecimalField(decimal_places=2,
                                     max_digits=12,
                                     verbose_name='Order total (inc. tax)')),
                ('total_excl_tax',
                 models.DecimalField(decimal_places=2,
                                     max_digits=12,
                                     verbose_name='Order total (excl. tax)')),
                ('shipping_incl_tax',
                 models.DecimalField(
                     decimal_places=2,
                     default=0,
                     max_digits=12,
                     verbose_name='Shipping charge (inc. tax)')),
                ('shipping_excl_tax',
                 models.DecimalField(
                     decimal_places=2,
                     default=0,
                     max_digits=12,
                     verbose_name='Shipping charge (excl. tax)')),
                ('shipping_method',
                 models.CharField(blank=True,
                                  max_length=128,
                                  verbose_name='Shipping method')),
                ('shipping_code',
                 models.CharField(blank=True, default=b'', max_length=128)),
                ('status',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='Status')),
                ('guest_email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='Guest email address')),
                ('date_placed', models.DateTimeField(db_index=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)),
                ('basket',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='basket.Basket',
                     verbose_name='Basket')),
                ('billing_address',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='order.BillingAddress',
                     verbose_name='Billing Address')),
                ('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')),
                ('shipping_address',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='order.ShippingAddress',
                     verbose_name='Shipping Address')),
                ('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')),
                ('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 Order',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Exemple #8
0
class Migration(migrations.Migration):

    dependencies = [
        ('catalogue',
         '0039_historicalproduct_historicalproductattributevalue'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('voucher', '0006_auto_20181205_1017'),
        ('sites', '0002_alter_domain_unique'),
        ('partner', '0014_historicalstockrecord'),
        ('offer', '0023_offerassignmentemailattempt'),
    ]

    operations = [
        migrations.CreateModel(
            name='HistoricalBenefit',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('type',
                 models.CharField(
                     blank=True,
                     choices=
                     [(b'Percentage',
                       "Discount is a percentage off of the product's value"),
                      (b'Absolute',
                       "Discount is a fixed amount off of the product's value"
                       ),
                      (b'Multibuy',
                       'Discount is to give the cheapest product for free'),
                      (b'Fixed price',
                       'Get the products that meet the condition for a fixed price'
                       ),
                      (b'Shipping absolute',
                       'Discount is a fixed amount of the shipping cost'),
                      (b'Shipping fixed price',
                       'Get shipping for a fixed price'),
                      (b'Shipping percentage',
                       'Discount is a percentage off of the shipping cost')],
                     max_length=128,
                     verbose_name='Type')),
                ('value',
                 oscar.models.fields.PositiveDecimalField(
                     blank=True,
                     decimal_places=2,
                     max_digits=12,
                     null=True,
                     verbose_name='Value')),
                ('max_affected_items',
                 models.PositiveIntegerField(
                     blank=True,
                     help_text=
                     'Set this to prevent the discount consuming all items within the range that are in the basket.',
                     null=True,
                     verbose_name='Max Affected Items')),
                ('proxy_class',
                 oscar.models.fields.NullCharField(
                     default=None, max_length=255,
                     verbose_name='Custom class')),
                ('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)),
                ('range',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='offer.Range',
                     verbose_name='Range')),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical Benefit',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalCondition',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('type',
                 models.CharField(
                     blank=True,
                     choices=
                     [(b'Count',
                       'Depends on number of items in basket that are in condition range'
                       ),
                      (b'Value',
                       'Depends on value of items in basket that are in condition range'
                       ),
                      (b'Coverage',
                       'Needs to contain a set number of DISTINCT items from the condition range'
                       )],
                     max_length=128,
                     verbose_name='Type')),
                ('value',
                 oscar.models.fields.PositiveDecimalField(
                     blank=True,
                     decimal_places=2,
                     max_digits=12,
                     null=True,
                     verbose_name='Value')),
                ('proxy_class',
                 oscar.models.fields.NullCharField(
                     default=None, max_length=255,
                     verbose_name='Custom class')),
                ('enterprise_customer_uuid',
                 models.UUIDField(blank=True,
                                  null=True,
                                  verbose_name='EnterpriseCustomer UUID')),
                ('enterprise_customer_name',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  verbose_name='EnterpriseCustomer Name')),
                ('enterprise_customer_catalog_uuid',
                 models.UUIDField(
                     blank=True,
                     null=True,
                     verbose_name='EnterpriseCustomerCatalog UUID')),
                ('program_uuid',
                 models.UUIDField(blank=True,
                                  null=True,
                                  verbose_name='Program UUID')),
                ('journal_bundle_uuid',
                 models.UUIDField(blank=True,
                                  null=True,
                                  verbose_name='JournalBundle 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)),
                ('range',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='offer.Range',
                     verbose_name='Range')),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical Condition',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalConditionalOffer',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('name',
                 models.CharField(
                     db_index=True,
                     help_text="This is displayed within the customer's basket",
                     max_length=128,
                     verbose_name='Name')),
                ('description',
                 models.TextField(
                     blank=True,
                     help_text='This is displayed on the offer browsing page',
                     verbose_name='Description')),
                ('offer_type',
                 models.CharField(choices=[
                     (b'Site', 'Site offer - available to all users'),
                     (b'Voucher',
                      'Voucher offer - only available after entering the appropriate voucher code'
                      ),
                     (b'User',
                      'User offer - available to certain types of user'),
                     (b'Session',
                      'Session offer - temporary offer, available for a user for the duration of their session'
                      )
                 ],
                                  default=b'Site',
                                  max_length=128,
                                  verbose_name='Type')),
                ('status',
                 models.CharField(default=b'Open',
                                  max_length=64,
                                  verbose_name='Status')),
                ('priority',
                 models.IntegerField(
                     default=0,
                     help_text='The highest priority offers are applied first',
                     verbose_name='Priority')),
                ('start_datetime',
                 models.DateTimeField(
                     blank=True,
                     help_text=
                     'Offers are active from the start date. Leave this empty if the offer has no start date.',
                     null=True,
                     verbose_name='Start date')),
                ('end_datetime',
                 models.DateTimeField(
                     blank=True,
                     help_text=
                     'Offers are active until the end date. Leave this empty if the offer has no expiry date.',
                     null=True,
                     verbose_name='End date')),
                ('max_global_applications',
                 models.PositiveIntegerField(
                     blank=True,
                     help_text=
                     'The number of times this offer can be used before it is unavailable',
                     null=True,
                     verbose_name='Max global applications')),
                ('max_user_applications',
                 models.PositiveIntegerField(
                     blank=True,
                     help_text=
                     'The number of times a single user can use this offer',
                     null=True,
                     verbose_name='Max user applications')),
                ('max_basket_applications',
                 models.PositiveIntegerField(
                     blank=True,
                     help_text=
                     'The number of times this offer can be applied to a basket (and order)',
                     null=True,
                     verbose_name='Max basket applications')),
                ('max_discount',
                 models.DecimalField(
                     blank=True,
                     decimal_places=2,
                     help_text=
                     'When an offer has given more discount to orders than this threshold, then the offer becomes unavailable',
                     max_digits=12,
                     null=True,
                     verbose_name='Max discount')),
                ('total_discount',
                 models.DecimalField(decimal_places=2,
                                     default=Decimal('0.00'),
                                     max_digits=12,
                                     verbose_name='Total Discount')),
                ('num_applications',
                 models.PositiveIntegerField(
                     default=0, verbose_name='Number of applications')),
                ('num_orders',
                 models.PositiveIntegerField(default=0,
                                             verbose_name='Number of Orders')),
                ('redirect_url',
                 oscar.models.fields.ExtendedURLField(
                     blank=True, verbose_name='URL redirect (optional)')),
                ('date_created',
                 models.DateTimeField(blank=True,
                                      editable=False,
                                      verbose_name='Date Created')),
                ('email_domains',
                 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)),
                ('benefit',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='offer.Benefit',
                     verbose_name='Benefit')),
                ('condition',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='offer.Condition',
                     verbose_name='Condition')),
                ('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,
                     default=None,
                     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 Conditional offer',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalOfferAssignment',
            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')),
                ('code', models.CharField(max_length=128)),
                ('user_email', models.EmailField(max_length=254)),
                ('status',
                 models.CharField(choices=[
                     (b'EMAIL_PENDING', 'Email to user pending.'),
                     (b'ASSIGNED', 'Code successfully assigned to user.'),
                     (b'REDEEMED', 'Code has been redeemed by user.'),
                     (b'EMAIL_BOUNCED', 'Email to user bounced.'),
                     (b'REVOKED', 'Code has been revoked for this user.')
                 ],
                                  default=b'EMAIL_PENDING',
                                  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)),
                ('offer',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='offer.ConditionalOffer')),
                ('voucher_application',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='voucher.VoucherApplication')),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical offer assignment',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalRange',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('name',
                 models.CharField(db_index=True,
                                  max_length=128,
                                  verbose_name='Name')),
                ('description', models.TextField(blank=True)),
                ('is_public',
                 models.BooleanField(
                     default=False,
                     help_text='Public ranges have a customer-facing page',
                     verbose_name='Is public?')),
                ('includes_all_products',
                 models.BooleanField(default=False,
                                     verbose_name='Includes all products?')),
                ('proxy_class',
                 oscar.models.fields.NullCharField(
                     db_index=True,
                     default=None,
                     max_length=255,
                     verbose_name='Custom class')),
                ('date_created',
                 models.DateTimeField(blank=True,
                                      editable=False,
                                      verbose_name='Date Created')),
                ('catalog_query', models.TextField(blank=True, null=True)),
                ('course_catalog',
                 models.PositiveIntegerField(
                     blank=True,
                     help_text='Course Catalog ID from the Discovery Service.',
                     null=True)),
                ('enterprise_customer',
                 models.UUIDField(
                     blank=True,
                     help_text=
                     'UUID for an EnterpriseCustomer from the Enterprise Service.',
                     null=True)),
                ('enterprise_customer_catalog',
                 models.UUIDField(
                     blank=True,
                     help_text=
                     'UUID for an EnterpriseCustomerCatalog from the Enterprise Service.',
                     null=True)),
                ('course_seat_types',
                 models.CharField(blank=True,
                                  max_length=255,
                                  null=True,
                                  validators=[
                                      ecommerce.extensions.offer.models.
                                      validate_credit_seat_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)),
                ('catalog',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='catalogue.Catalog')),
                ('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 Range',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalRangeProduct',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('display_order', models.IntegerField(default=0)),
                ('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='catalogue.Product')),
                ('range',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='offer.Range')),
            ],
            options={
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
                'verbose_name': 'historical range product',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Exemple #9
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("news", "0010_newspage_result_weighting"),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalNewsCategory",
            fields=[
                (
                    "id",
                    models.IntegerField(auto_created=True,
                                        blank=True,
                                        db_index=True,
                                        verbose_name="ID"),
                ),
                ("slug", models.SlugField(max_length=255)),
                ("category", models.CharField(db_index=True, 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,
                    ),
                ),
                (
                    "lead_story",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="news.newspage",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical news category",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalComment",
            fields=[
                (
                    "id",
                    models.IntegerField(auto_created=True,
                                        blank=True,
                                        db_index=True,
                                        verbose_name="ID"),
                ),
                ("legacy_id", models.IntegerField(null=True)),
                (
                    "legacy_author_name",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "legacy_author_email",
                    models.EmailField(blank=True, max_length=254, null=True),
                ),
                ("content", models.TextField()),
                ("posted_date",
                 models.DateTimeField(default=datetime.datetime.now)),
                ("history_id",
                 models.AutoField(primary_key=True, serialize=False)),
                ("history_date", models.DateTimeField()),
                ("history_change_reason",
                 models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"),
                                 ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "author",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=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,
                    ),
                ),
                (
                    "news_page",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="news.newspage",
                    ),
                ),
                (
                    "parent",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="news.comment",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical comment",
                "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),
        ("clubs", "0030_auto_20200818_1835"),
    ]

    operations = [
        migrations.AddField(
            model_name="club",
            name="ghost",
            field=models.BooleanField(default=False),
        ),
        migrations.CreateModel(
            name="HistoricalClub",
            fields=[
                (
                    "id",
                    models.IntegerField(auto_created=True,
                                        blank=True,
                                        db_index=True,
                                        verbose_name="ID"),
                ),
                ("approved", models.BooleanField(default=None, null=True)),
                ("approved_comment", models.TextField(blank=True, null=True)),
                ("approved_on", models.DateTimeField(blank=True, null=True)),
                ("fair", models.BooleanField(default=False)),
                ("code", models.SlugField(max_length=255)),
                ("active", models.BooleanField(default=False)),
                ("name", models.CharField(max_length=255)),
                ("subtitle", models.CharField(blank=True, max_length=255)),
                ("description", models.TextField(blank=True)),
                ("founded", models.DateField(blank=True, null=True)),
                (
                    "size",
                    models.IntegerField(choices=[(1, "1-20"), (2, "21-50"),
                                                 (3, "51-100"), (4, "101+")],
                                        default=1),
                ),
                ("email",
                 models.EmailField(blank=True, max_length=254, null=True)),
                ("facebook", models.URLField(blank=True, null=True)),
                ("website", models.URLField(blank=True, null=True)),
                ("twitter", models.URLField(blank=True, null=True)),
                ("instagram", models.URLField(blank=True, null=True)),
                ("linkedin", models.URLField(blank=True, null=True)),
                ("github", models.URLField(blank=True, null=True)),
                ("youtube", models.URLField(blank=True, null=True)),
                ("how_to_get_involved", models.TextField(blank=True)),
                (
                    "application_required",
                    models.IntegerField(
                        choices=[
                            (1, "No Application Required"),
                            (2, "Application Required For Some Positions"),
                            (3, "Application Required For All Positions"),
                        ],
                        default=3,
                    ),
                ),
                ("accepting_members", models.BooleanField(default=False)),
                ("listserv", models.CharField(blank=True, max_length=255)),
                ("image",
                 models.CharField(blank=True, max_length=100, null=True)),
                ("created_at", models.DateTimeField(blank=True,
                                                    editable=False)),
                ("updated_at", models.DateTimeField(blank=True,
                                                    editable=False)),
                ("ghost", 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),
                ),
                (
                    "approved_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,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical club",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Exemple #11
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name="DataRequest",
            fields=[
                (
                    "created",
                    models.DateTimeField(blank=True,
                                         default=edc_utils.date.get_utcnow),
                ),
                (
                    "modified",
                    models.DateTimeField(blank=True,
                                         default=edc_utils.date.get_utcnow),
                ),
                (
                    "user_created",
                    edc_model_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    edc_model_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    edc_model_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("name", models.CharField(max_length=25)),
                ("description", models.TextField(null=True)),
                ("decrypt", models.BooleanField(default=False)),
                (
                    "export_format",
                    models.CharField(choices=[("CSV", "CSV")],
                                     default="CSV",
                                     max_length=25),
                ),
                (
                    "models",
                    models.TextField(
                        help_text=
                        'List one table per line, no commas. Use "label lower" format.'
                    ),
                ),
            ],
            options={"ordering": ("name", )},
        ),
        migrations.CreateModel(
            name="DataRequestHistory",
            fields=[
                (
                    "created",
                    models.DateTimeField(blank=True,
                                         default=edc_utils.date.get_utcnow),
                ),
                (
                    "modified",
                    models.DateTimeField(blank=True,
                                         default=edc_utils.date.get_utcnow),
                ),
                (
                    "user_created",
                    edc_model_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    edc_model_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    edc_model_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("archive_filename", models.CharField(max_length=200,
                                                      null=True)),
                ("emailed_to", models.EmailField(max_length=254, null=True)),
                ("emailed_datetime", models.DateTimeField(null=True)),
                ("summary", models.TextField(null=True)),
                (
                    "exported_datetime",
                    models.DateTimeField(default=edc_utils.date.get_utcnow),
                ),
                (
                    "data_request",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="edc_pdutils.DataRequest",
                    ),
                ),
            ],
            options={"ordering": ("-exported_datetime", )},
        ),
        migrations.CreateModel(
            name="HistoricalDataRequest",
            fields=[
                (
                    "created",
                    models.DateTimeField(blank=True,
                                         default=edc_utils.date.get_utcnow),
                ),
                (
                    "modified",
                    models.DateTimeField(blank=True,
                                         default=edc_utils.date.get_utcnow),
                ),
                (
                    "user_created",
                    edc_model_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user created",
                    ),
                ),
                (
                    "user_modified",
                    edc_model_fields.fields.userfield.UserField(
                        blank=True,
                        help_text="Updated by admin.save_model",
                        max_length=50,
                        verbose_name="user modified",
                    ),
                ),
                (
                    "hostname_created",
                    models.CharField(
                        blank=True,
                        default=_socket.gethostname,
                        help_text="System field. (modified on create only)",
                        max_length=60,
                    ),
                ),
                (
                    "hostname_modified",
                    edc_model_fields.fields.hostname_modification_field.
                    HostnameModificationField(
                        blank=True,
                        help_text="System field. (modified on every save)",
                        max_length=50,
                    ),
                ),
                (
                    "revision",
                    django_revision.revision_field.RevisionField(
                        blank=True,
                        editable=False,
                        help_text=
                        "System field. Git repository tag:branch:commit.",
                        max_length=75,
                        null=True,
                        verbose_name="Revision",
                    ),
                ),
                ("device_created", models.CharField(blank=True,
                                                    max_length=10)),
                ("device_modified", models.CharField(blank=True,
                                                     max_length=10)),
                (
                    "id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        blank=True,
                        db_index=True,
                        editable=False,
                        help_text="System auto field. UUID primary key.",
                    ),
                ),
                ("name", models.CharField(max_length=25)),
                ("description", models.TextField(null=True)),
                ("decrypt", models.BooleanField(default=False)),
                (
                    "export_format",
                    models.CharField(choices=[("CSV", "CSV")],
                                     default="CSV",
                                     max_length=25),
                ),
                (
                    "models",
                    models.TextField(
                        help_text=
                        'List one table per line, no commas. Use "label lower" format.'
                    ),
                ),
                ("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_id",
                    django_audit_fields.fields.uuid_auto_field.UUIDAutoField(
                        primary_key=True, serialize=False),
                ),
                (
                    "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 data request",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": "history_date",
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Exemple #12
0
class Migration(migrations.Migration):

    initial = True

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

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