예제 #1
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, 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(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, 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')),
                ('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')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
            ],
            options={
                'verbose_name': 'bruger',
                'verbose_name_plural': 'brugere',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='ActivityDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128, verbose_name='Navn')),
                ('activity_id', models.CharField(max_length=128, unique=True, verbose_name='aktivitets ID')),
                ('max_tolerance_in_percent', models.PositiveSmallIntegerField(verbose_name='max tolerance i procent')),
                ('max_tolerance_in_dkk', models.PositiveIntegerField(verbose_name='max tolerance i DKK')),
                ('main_activities', models.ManyToManyField(blank=True, related_name='supplementary_activities', to='core.ActivityDetails', verbose_name='tilladte hovedaktiviteter')),
            ],
            options={
                'verbose_name': 'aktivitetsdetalje',
                'verbose_name_plural': 'aktivitetsdetaljer',
            },
        ),
        migrations.CreateModel(
            name='ApprovalLevel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128, verbose_name='navn')),
            ],
            options={
                'verbose_name': 'bevillingsniveau',
                'verbose_name_plural': 'bevillingsniveauer',
            },
        ),
        migrations.CreateModel(
            name='Case',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('revision', models.CharField(blank=True, editable=False, help_text='System field. Git repository tag:branch:commit.', max_length=75, null=True, verbose_name='Revision')),
                ('created', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
                ('modified', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
                ('user_created', models.CharField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user created')),
                ('user_modified', models.CharField(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', models.CharField(blank=True, help_text='System field. (modified on every save)', max_length=50)),
                ('device_created', models.CharField(blank=True, max_length=10)),
                ('device_modified', models.CharField(blank=True, max_length=10)),
                ('sbsys_id', models.CharField(max_length=128, unique=True, verbose_name='SBSYS-ID')),
                ('cpr_number', models.CharField(max_length=10, verbose_name='cpr-nummer')),
                ('name', models.CharField(max_length=128, verbose_name='navn')),
                ('target_group', models.CharField(choices=[('FAMILY_DEPT', 'familieafdelingen'), ('DISABILITY_DEPT', 'handicapafdelingen')], max_length=128, verbose_name='målgruppe')),
                ('effort_step', models.PositiveSmallIntegerField(choices=[(1, 'Trin 1: Tidlig indsats i almenområdet'), (2, 'Trin 2: Forebyggelse'), (3, 'Trin 3: Hjemmebaserede indsatser'), (4, 'Trin 4: Anbringelse i slægt eller netværk'), (5, 'Trin 5: Anbringelse i forskellige typer af plejefamilier'), (6, 'Trin 6: Anbringelse i institutionstilbud')], verbose_name='indsatstrappe')),
                ('scaling_step', models.PositiveSmallIntegerField(choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10)], verbose_name='skaleringstrappe')),
                ('assessment_comment', models.TextField(blank=True, verbose_name='supplerende oplysninger til vurdering')),
                ('refugee_integration', models.BooleanField(default=False, verbose_name='integrationsindsatsen')),
                ('cross_department_measure', models.BooleanField(default=False, verbose_name='tværgående ungeindsats')),
                ('note', models.TextField(blank=True, verbose_name='note')),
            ],
            options={
                'verbose_name': 'sag',
                'verbose_name_plural': 'sager',
            },
        ),
        migrations.CreateModel(
            name='Municipality',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128, verbose_name='navn')),
            ],
            options={
                'verbose_name': 'kommune',
                'verbose_name_plural': 'kommuner',
            },
        ),
        migrations.CreateModel(
            name='PaymentMethodDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tax_card', models.CharField(choices=[('MAIN_CARD', 'Hovedkort'), ('SECONDARY_CARD', 'Bikort')], max_length=128, verbose_name='skattekort')),
            ],
            options={
                'verbose_name': 'betalingsmåde detalje',
                'verbose_name_plural': 'betalingsmåde detaljer',
            },
        ),
        migrations.CreateModel(
            name='SchoolDistrict',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128, verbose_name='navn')),
            ],
            options={
                'verbose_name': 'distrikt',
                'verbose_name_plural': 'distrikter',
            },
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('paragraph', models.CharField(max_length=128, verbose_name='paragraf')),
                ('text', models.TextField(verbose_name='forklarende tekst')),
                ('allowed_for_family_target_group', models.BooleanField(default=False, verbose_name='tilladt for familieafdelingen')),
                ('allowed_for_disability_target_group', models.BooleanField(default=False, verbose_name='tilladt for handicapafdelingen')),
                ('allowed_for_steps', django.contrib.postgres.fields.ArrayField(base_field=models.PositiveSmallIntegerField(choices=[(1, 'Trin 1: Tidlig indsats i almenområdet'), (2, 'Trin 2: Forebyggelse'), (3, 'Trin 3: Hjemmebaserede indsatser'), (4, 'Trin 4: Anbringelse i slægt eller netværk'), (5, 'Trin 5: Anbringelse i forskellige typer af plejefamilier'), (6, 'Trin 6: Anbringelse i institutionstilbud')]), size=6, verbose_name='tilladt for trin i indsatstrappen')),
                ('law_text_name', models.CharField(max_length=128, verbose_name='lov tekst navn')),
            ],
            options={
                'verbose_name': 'paragraf',
                'verbose_name_plural': 'paragraffer',
            },
        ),
        migrations.CreateModel(
            name='ServiceProvider',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cvr_number', models.CharField(blank=True, max_length=8, verbose_name='cvr-nummer')),
                ('name', models.CharField(max_length=128, verbose_name='navn')),
                ('vat_factor', models.DecimalField(decimal_places=2, default=100.0, max_digits=5, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='momsfaktor')),
            ],
            options={
                'verbose_name': 'leverandør',
                'verbose_name_plural': 'leverandører',
            },
        ),
        migrations.CreateModel(
            name='Team',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128, verbose_name='navn')),
                ('leader', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='managed_teams', to=settings.AUTH_USER_MODEL, verbose_name='leder')),
            ],
        ),
        migrations.CreateModel(
            name='SectionInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('kle_number', models.CharField(blank=True, max_length=128, verbose_name='KLE-nummer')),
                ('sbsys_template_id', models.CharField(blank=True, max_length=128, verbose_name='SBSYS skabelon-id')),
                ('activity_details', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.ActivityDetails')),
                ('section', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Section')),
            ],
            options={
                'verbose_name': 'paragraf-info',
                'verbose_name_plural': 'paragraf-info',
            },
        ),
        migrations.CreateModel(
            name='RelatedPerson',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('relation_type', models.CharField(max_length=128, verbose_name='relation')),
                ('cpr_number', models.CharField(blank=True, max_length=10, verbose_name='cpr-nummer')),
                ('name', models.CharField(max_length=128, verbose_name='navn')),
                ('related_case', models.CharField(blank=True, max_length=128, verbose_name='SBSYS-sag')),
                ('main_case', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='related_persons', to='core.Case', verbose_name='hovedsag')),
            ],
            options={
                'verbose_name': 'relateret person',
                'verbose_name_plural': 'relaterede personer',
            },
        ),
        migrations.CreateModel(
            name='PaymentSchedule',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('recipient_type', models.CharField(choices=[('INTERNAL', 'Intern'), ('PERSON', 'Person'), ('COMPANY', 'Firma')], max_length=128, verbose_name='betalingsmodtager')),
                ('recipient_id', models.CharField(max_length=128, verbose_name='ID')),
                ('recipient_name', models.CharField(max_length=128, verbose_name='navn')),
                ('payment_method', models.CharField(choices=[('CASH', 'Udbetaling'), ('SD', 'SD-LØN'), ('INVOICE', 'Faktura'), ('INTERNAL', 'Intern afregning')], max_length=128, verbose_name='betalingsmåde')),
                ('payment_frequency', models.CharField(blank=True, choices=[('DAILY', 'Dagligt'), ('WEEKLY', 'Ugentligt'), ('BIWEEKLY', 'Hver 2. uge'), ('MONTHLY', 'Månedligt')], max_length=128, null=True, verbose_name='betalingsfrekvens')),
                ('payment_day_of_month', models.IntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(31)], verbose_name='betales d.')),
                ('payment_type', models.CharField(choices=[('ONE_TIME_PAYMENT', 'Engangsudgift'), ('RUNNING_PAYMENT', 'Fast beløb, løbende'), ('PER_HOUR_PAYMENT', 'Takst pr. time'), ('PER_DAY_PAYMENT', 'Takst pr. døgn'), ('PER_KM_PAYMENT', 'Takst pr. kilometer')], max_length=128, verbose_name='betalingstype')),
                ('payment_units', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))], verbose_name='betalingsenheder')),
                ('payment_amount', models.DecimalField(decimal_places=2, max_digits=14, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='beløb')),
                ('payment_id', models.UUIDField(default=uuid.uuid4, editable=False)),
                ('payment_method_details', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.PaymentMethodDetails', verbose_name='betalingsmåde detalje')),
            ],
            options={
                'verbose_name': 'betalingsplan',
                'verbose_name_plural': 'betalingsplaner',
            },
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(verbose_name='betalingsdato')),
                ('recipient_type', models.CharField(choices=[('INTERNAL', 'Intern'), ('PERSON', 'Person'), ('COMPANY', 'Firma')], max_length=128, verbose_name='betalingsmodtager')),
                ('recipient_id', models.CharField(max_length=128, verbose_name='ID')),
                ('recipient_name', models.CharField(max_length=128, verbose_name='Navn')),
                ('payment_method', models.CharField(choices=[('CASH', 'Udbetaling'), ('SD', 'SD-LØN'), ('INVOICE', 'Faktura'), ('INTERNAL', 'Intern afregning')], max_length=128, verbose_name='betalingsmåde')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=14, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='beløb')),
                ('paid', models.BooleanField(default=False, verbose_name='betalt')),
                ('payment_schedule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payments', to='core.PaymentSchedule', verbose_name='betalingsplan')),
            ],
            options={
                'verbose_name': 'betaling',
                'verbose_name_plural': 'betalinger',
            },
        ),
        migrations.CreateModel(
            name='HistoricalCase',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('revision', models.CharField(blank=True, editable=False, help_text='System field. Git repository tag:branch:commit.', max_length=75, null=True, verbose_name='Revision')),
                ('created', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
                ('modified', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
                ('user_created', models.CharField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user created')),
                ('user_modified', models.CharField(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', models.CharField(blank=True, help_text='System field. (modified on every save)', max_length=50)),
                ('device_created', models.CharField(blank=True, max_length=10)),
                ('device_modified', models.CharField(blank=True, max_length=10)),
                ('effort_step', models.PositiveSmallIntegerField(choices=[(1, 'Trin 1: Tidlig indsats i almenområdet'), (2, 'Trin 2: Forebyggelse'), (3, 'Trin 3: Hjemmebaserede indsatser'), (4, 'Trin 4: Anbringelse i slægt eller netværk'), (5, 'Trin 5: Anbringelse i forskellige typer af plejefamilier'), (6, 'Trin 6: Anbringelse i institutionstilbud')], verbose_name='indsatstrappe')),
                ('scaling_step', models.PositiveSmallIntegerField(choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10)], verbose_name='skaleringstrappe')),
                ('assessment_comment', models.TextField(blank=True, verbose_name='supplerende oplysninger til vurdering')),
                ('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)),
                ('case_worker', 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='sagsbehandler')),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('team', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='core.Team', verbose_name='team')),
            ],
            options={
                'verbose_name': 'historical sag',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.AddField(
            model_name='case',
            name='acting_municipality',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='acts_on', to='core.Municipality', verbose_name='handlekommune'),
        ),
        migrations.AddField(
            model_name='case',
            name='case_worker',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='cases', to=settings.AUTH_USER_MODEL, verbose_name='sagsbehandler'),
        ),
        migrations.AddField(
            model_name='case',
            name='district',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='cases', to='core.SchoolDistrict', verbose_name='skoledistrikt'),
        ),
        migrations.AddField(
            model_name='case',
            name='paying_municipality',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='pays_for', to='core.Municipality', verbose_name='betalingskommune'),
        ),
        migrations.AddField(
            model_name='case',
            name='residence_municipality',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='resident_clients', to='core.Municipality', verbose_name='bopælskommune'),
        ),
        migrations.AddField(
            model_name='case',
            name='team',
            field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.PROTECT, related_name='cases', to='core.Team', verbose_name='team'),
        ),
        migrations.CreateModel(
            name='Appropriation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('revision', models.CharField(blank=True, editable=False, help_text='System field. Git repository tag:branch:commit.', max_length=75, null=True, verbose_name='Revision')),
                ('created', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
                ('modified', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
                ('user_created', models.CharField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user created')),
                ('user_modified', models.CharField(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', models.CharField(blank=True, help_text='System field. (modified on every save)', max_length=50)),
                ('device_created', models.CharField(blank=True, max_length=10)),
                ('device_modified', models.CharField(blank=True, max_length=10)),
                ('sbsys_id', models.CharField(max_length=128, unique=True, verbose_name='SBSYS-ID')),
                ('note', models.TextField(blank=True, verbose_name='supplerende oplysninger')),
                ('case', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='appropriations', to='core.Case', verbose_name='sag')),
                ('section', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='appropriations', to='core.Section', verbose_name='paragraf')),
            ],
            options={
                'verbose_name': 'bevilling',
                'verbose_name_plural': 'bevillinger',
            },
        ),
        migrations.AddField(
            model_name='activitydetails',
            name='main_activity_for',
            field=models.ManyToManyField(blank=True, related_name='main_activities', through='core.SectionInfo', to='core.Section', verbose_name='hovedaktivitet for paragraffer'),
        ),
        migrations.AddField(
            model_name='activitydetails',
            name='service_providers',
            field=models.ManyToManyField(blank=True, related_name='supplied_activities', to='core.ServiceProvider', verbose_name='leverandører'),
        ),
        migrations.AddField(
            model_name='activitydetails',
            name='supplementary_activity_for',
            field=models.ManyToManyField(blank=True, related_name='supplementary_activities', to='core.Section', verbose_name='følgeudgift for paragraffer'),
        ),
        migrations.CreateModel(
            name='Activity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('revision', models.CharField(blank=True, editable=False, help_text='System field. Git repository tag:branch:commit.', max_length=75, null=True, verbose_name='Revision')),
                ('created', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
                ('modified', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
                ('user_created', models.CharField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user created')),
                ('user_modified', models.CharField(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', models.CharField(blank=True, help_text='System field. (modified on every save)', max_length=50)),
                ('device_created', models.CharField(blank=True, max_length=10)),
                ('device_modified', models.CharField(blank=True, max_length=10)),
                ('status', models.CharField(choices=[('DRAFT', 'kladde'), ('EXPECTED', 'forventet'), ('GRANTED', 'bevilget')], max_length=128, verbose_name='status')),
                ('approval_note', models.TextField(blank=True, verbose_name='evt. bemærkning')),
                ('appropriation_date', models.DateField(blank=True, null=True, verbose_name='bevillingsdato')),
                ('start_date', models.DateField(verbose_name='startdato')),
                ('end_date', models.DateField(blank=True, null=True, verbose_name='slutdato')),
                ('activity_type', models.CharField(choices=[('MAIN_ACTIVITY', 'hovedaktivitet'), ('SUPPL_ACTIVITY', 'følgeaktivitet')], max_length=128, verbose_name='type')),
                ('note', models.TextField(blank=True, max_length=1000, null=True)),
                ('appropriation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activities', to='core.Appropriation', verbose_name='bevilling')),
                ('approval_level', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='approved_activities', to='core.ApprovalLevel', verbose_name='bevillingsniveau')),
                ('approval_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='approved_activities', to=settings.AUTH_USER_MODEL, verbose_name='bevilget af bruger')),
                ('details', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='core.ActivityDetails', verbose_name='aktivitetsdetalje')),
                ('modifies', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='modified_by', to='core.Activity')),
                ('payment_plan', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.PaymentSchedule', verbose_name='betalingsplan')),
                ('service_provider', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='activities', to='core.ServiceProvider', verbose_name='leverandør')),
            ],
            options={
                'verbose_name': 'aktivitet',
                'verbose_name_plural': 'aktiviteter',
            },
        ),
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.CharField(max_length=128, verbose_name='konteringsnummer')),
                ('main_activity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='main_accounts', to='core.ActivityDetails', verbose_name='hovedaktivitet')),
                ('section', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='accounts', to='core.Section', verbose_name='paragraf')),
                ('supplementary_activity', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='supplementary_accounts', to='core.ActivityDetails', verbose_name='følgeudgift')),
            ],
            options={
                'verbose_name': 'konto',
                'verbose_name_plural': 'konti',
            },
        ),
        migrations.AddField(
            model_name='user',
            name='team',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='users', to='core.Team'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'),
        ),
        migrations.AddConstraint(
            model_name='activity',
            constraint=models.CheckConstraint(check=models.Q(start_date__lte=django.db.models.expressions.F('end_date')), name='end_date_after_start_date'),
        ),
        migrations.AddConstraint(
            model_name='activity',
            constraint=models.UniqueConstraint(condition=models.Q(('activity_type', 'MAIN_ACTIVITY'), ('modifies__isnull', True)), fields=('appropriation',), name='unique_main_activity'),
        ),
        migrations.AddConstraint(
            model_name='account',
            constraint=models.UniqueConstraint(fields=('main_activity', 'supplementary_activity', 'section'), name='unique_account_number'),
        ),
    ]
예제 #2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='AdvUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  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(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     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')),
                ('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')),
                ('is_activated',
                 models.BooleanField(
                     db_index=True,
                     default=True,
                     help_text=
                     'Пользовательский аккаунт, который прошел процесс подтверждения',
                     verbose_name='Подтверждение аккаунта')),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Answer',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content',
                 models.TextField(db_index=True,
                                  help_text='Описание возможного ответа',
                                  verbose_name='Ответ')),
                ('is_true',
                 models.BooleanField(
                     db_index=True,
                     default=False,
                     help_text='Статус правильного ответ на вопорос',
                     verbose_name='Правильный ответ')),
                ('is_active',
                 models.BooleanField(
                     db_index=True,
                     default=True,
                     help_text='Учитывать ответ при отображение вопроса',
                     verbose_name='Ответ учтен')),
            ],
            options={
                'verbose_name': 'Ответ',
                'verbose_name_plural': 'Ответы',
            },
        ),
        migrations.CreateModel(
            name='Exam',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('answer',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   related_name='exams',
                                   to='main.Answer',
                                   verbose_name='Выбранный ответ')),
            ],
            options={
                'verbose_name': 'Ответил',
                'verbose_name_plural': 'Ответили',
            },
        ),
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(db_index=True,
                                  help_text='Название класса или группы',
                                  max_length=100,
                                  verbose_name='Название')),
                ('is_active',
                 models.BooleanField(db_index=True,
                                     default=True,
                                     help_text='Опубликовать группу на сайте',
                                     verbose_name='Отображение на сайте')),
            ],
            options={
                'verbose_name': 'Группа',
                'verbose_name_plural': 'Группы',
                'ordering': ('name', ),
                'unique_together': {('name', 'is_active')},
            },
        ),
        migrations.CreateModel(
            name='Lesson',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(
                     db_index=True,
                     help_text='Предмет, знания которого проверяются в тесте',
                     max_length=100,
                     verbose_name='Название')),
                ('is_active',
                 models.BooleanField(db_index=True,
                                     default=True,
                                     help_text='Опубликовать предмет на сайте',
                                     verbose_name='Отображение на сайте')),
            ],
            options={
                'verbose_name': 'Предмет',
                'verbose_name_plural': 'Предметы',
                'ordering': ('name', ),
                'unique_together': {('name', 'is_active')},
            },
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(db_index=True,
                                  help_text='Короткое название теста',
                                  max_length=100,
                                  verbose_name='Название теста')),
                ('max_score',
                 models.PositiveIntegerField(
                     default=12,
                     help_text=
                     'Максимальное количество балов которые можно набрать за все правильные ответы в тесте',
                     verbose_name='Максимальная оценка')),
                ('content',
                 models.TextField(db_index=True,
                                  help_text='Детальное описание теста',
                                  verbose_name='Описание теста')),
                ('is_active',
                 models.BooleanField(db_index=True,
                                     default=False,
                                     help_text='Опубликовать тест на сайте',
                                     verbose_name='Отображение на сайте')),
                ('groups',
                 models.ManyToManyField(help_text='Название класса или группы',
                                        to='main.Group',
                                        verbose_name='Названия')),
                ('lesson',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   related_name='tasks',
                                   to='main.Lesson',
                                   verbose_name='Предмет')),
            ],
            options={
                'verbose_name': 'Тест',
                'verbose_name_plural': 'Тесты',
                'ordering': ('id', ),
            },
        ),
        migrations.CreateModel(
            name='Test',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('test_score',
                 models.FloatField(blank=True,
                                   db_index=True,
                                   default=None,
                                   verbose_name='Оценка')),
                ('exam',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='main.Exam')),
                ('task',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='main.Task')),
            ],
            options={
                'verbose_name': 'Сданный тест',
                'verbose_name_plural': 'Сданные тесты',
            },
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content',
                 models.TextField(
                     help_text='Описание задаваемого вопроса в тесте',
                     verbose_name='Задание')),
                ('score',
                 models.FloatField(
                     default=1.0,
                     help_text=
                     'Количество балов начисленных за правильный ответ',
                     verbose_name='Балов за ответ')),
                ('variant',
                 models.PositiveIntegerField(
                     db_index=True,
                     default=1,
                     help_text='При создании нескольких вариантов теста',
                     verbose_name='№ варианта')),
                ('type_answer',
                 models.BooleanField(
                     db_index=True,
                     default=False,
                     help_text='Возможность выбора нескольких вариантов ответа',
                     verbose_name='Множественный выбор')),
                ('is_active',
                 models.BooleanField(db_index=True,
                                     default=True,
                                     help_text='Учитывать вопрос в тесте',
                                     verbose_name='Задание учтено')),
                ('test',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   related_name='questions',
                                   to='main.Task',
                                   verbose_name='Тест')),
            ],
            options={
                'verbose_name': 'Задание',
                'verbose_name_plural': 'Задания',
                'ordering': ('variant', 'test', 'content'),
            },
        ),
        migrations.AddField(
            model_name='exam',
            name='tasks',
            field=models.ManyToManyField(through='main.Test', to='main.Task'),
        ),
        migrations.AddField(
            model_name='exam',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='exams',
                to=settings.AUTH_USER_MODEL,
                verbose_name='Пользователь'),
        ),
        migrations.AddField(
            model_name='answer',
            name='question',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name='answers',
                to='main.Question',
                verbose_name='Вопрос'),
        ),
        migrations.AddConstraint(
            model_name='test',
            constraint=models.CheckConstraint(check=models.Q(
                ('test_score__gte', 0), ('test_score', None), _connector='OR'),
                                              name='test_score_non_negative'),
        ),
        migrations.AddConstraint(
            model_name='task',
            constraint=models.CheckConstraint(check=models.Q(max_score__gt=0),
                                              name='max_score_above_zero'),
        ),
        migrations.AlterUniqueTogether(
            name='task',
            unique_together={('name', 'lesson', 'content', 'is_active')},
        ),
        migrations.AddConstraint(
            model_name='question',
            constraint=models.CheckConstraint(check=models.Q(score__gt=0),
                                              name='score_above_zero'),
        ),
        migrations.AddConstraint(
            model_name='question',
            constraint=models.CheckConstraint(check=models.Q(variant__gte=1),
                                              name='variant_above_zero'),
        ),
        migrations.AlterUniqueTogether(
            name='question',
            unique_together={('content', 'test', 'variant', 'is_active')},
        ),
        migrations.AlterUniqueTogether(
            name='exam',
            unique_together={('user', 'answer')},
        ),
        migrations.AlterUniqueTogether(
            name='answer',
            unique_together={('content', 'question', 'is_active')},
        ),
    ]
예제 #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='Activity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(choices=[('HW', 'Homework'), ('QZ', 'Quiz'), ('NT', 'Notification')], max_length=2)),
                ('title', models.TextField()),
                ('content', models.TextField()),
                ('create_date', models.DateTimeField(auto_now=True)),
                ('due_date', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='Class',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('class_name', models.CharField(max_length=200)),
                ('create_date', models.DateTimeField(auto_now=True)),
                ('info', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='Discuss',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('create_time', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='File',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('class_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Class')),
            ],
        ),
        migrations.CreateModel(
            name='Problem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('question', models.TextField()),
                ('type', models.CharField(choices=[('CH', 'Choice'), ('BK', 'Blank'), ('TX', 'Text'), ('FL', 'File')], max_length=2)),
                ('key', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.CharField(max_length=50)),
                ('name', models.CharField(max_length=50)),
                ('class_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Class')),
            ],
        ),
        migrations.CreateModel(
            name='Submit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.TextField()),
                ('file', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.File')),
                ('problem', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Problem')),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('info', models.TextField()),
            ],
            options={
                'verbose_name_plural': 'users',
                'abstract': False,
                'verbose_name': 'user',
            },
            bases=('auth.user',),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Admin',
            fields=[
                ('id', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='db.User')),
                ('role', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('id', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='db.User')),
                ('student_id', models.CharField(max_length=50)),
                ('dept', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='TA',
            fields=[
                ('id', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='db.User')),
                ('ta_id', models.CharField(max_length=50)),
                ('dept', models.CharField(max_length=50)),
                ('authority', models.BinaryField()),
            ],
        ),
        migrations.CreateModel(
            name='Teacher',
            fields=[
                ('id', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='db.User')),
                ('teacher_id', models.CharField(max_length=50)),
                ('dept', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='SubmitScore',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('score', models.CharField(max_length=10)),
                ('time', models.DateTimeField(auto_now=True)),
                ('rater', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.User')),
                ('submit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Submit')),
            ],
        ),
        migrations.CreateModel(
            name='SectionHasFile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.File')),
                ('section', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Section')),
            ],
        ),
        migrations.AddField(
            model_name='section',
            name='files',
            field=models.ManyToManyField(through='db.SectionHasFile', to='db.File'),
        ),
        migrations.AddField(
            model_name='section',
            name='subsection',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Section'),
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField()),
                ('create_time', models.DateTimeField(auto_now=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.User')),
                ('discuss', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Discuss')),
                ('reply', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='db.Post')),
            ],
        ),
        migrations.AddField(
            model_name='file',
            name='uploader',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.User'),
        ),
        migrations.AddField(
            model_name='discuss',
            name='author',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.User'),
        ),
        migrations.AddField(
            model_name='discuss',
            name='class_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Class'),
        ),
        migrations.CreateModel(
            name='ActivityHasProblem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('activity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Activity')),
                ('problem', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Problem')),
            ],
        ),
        migrations.CreateModel(
            name='ActivityHasFile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('activity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Activity')),
                ('file', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.File')),
            ],
        ),
        migrations.AddField(
            model_name='activity',
            name='author',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.User'),
        ),
        migrations.AddField(
            model_name='activity',
            name='class_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Class'),
        ),
        migrations.AddField(
            model_name='activity',
            name='files',
            field=models.ManyToManyField(through='db.ActivityHasFile', to='db.File'),
        ),
        migrations.AddField(
            model_name='activity',
            name='problems',
            field=models.ManyToManyField(through='db.ActivityHasProblem', to='db.Problem'),
        ),
        migrations.CreateModel(
            name='TeachMembership',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now=True)),
                ('class_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Class')),
                ('teacher', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Teacher')),
            ],
        ),
        migrations.CreateModel(
            name='TAMembership',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now=True)),
                ('class_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Class')),
                ('ta', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.TA')),
            ],
        ),
        migrations.AddField(
            model_name='submit',
            name='student',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Student'),
        ),
        migrations.CreateModel(
            name='StudentMembership',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now=True)),
                ('class_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Class')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Student')),
            ],
        ),
        migrations.CreateModel(
            name='GroupMembership',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now=True)),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Group')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='db.Student')),
            ],
        ),
        migrations.AddField(
            model_name='group',
            name='members',
            field=models.ManyToManyField(through='db.GroupMembership', to='db.Student'),
        ),
        migrations.AddField(
            model_name='class',
            name='students',
            field=models.ManyToManyField(through='db.StudentMembership', to='db.Student'),
        ),
        migrations.AddField(
            model_name='class',
            name='tas',
            field=models.ManyToManyField(through='db.TAMembership', to='db.TA'),
        ),
        migrations.AddField(
            model_name='class',
            name='teachers',
            field=models.ManyToManyField(through='db.TeachMembership', to='db.Teacher'),
        ),
        migrations.AddConstraint(
            model_name='activity',
            constraint=models.CheckConstraint(check=models.Q(due_date__gt=django.db.models.expressions.F('create_date')), name='check_due_time'),
        ),
    ]
예제 #4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('first_name', models.CharField(max_length=16)),
                ('last_name', models.CharField(max_length=16)),
                ('email', models.EmailField(max_length=32, unique=True)),
                ('username',
                 models.CharField(max_length=16,
                                  unique=True,
                                  validators=[
                                      django.core.validators.RegexValidator(
                                          '^[a-zA-Z0-9_]*$')
                                  ])),
                ('password', models.CharField(max_length=128)),
                ('birthdate', models.DateField(blank=True, null=True)),
                ('daily_progress',
                 models.FloatField(
                     default=0,
                     validators=[
                         core.validators.BothIncludedRangeValidator(0, 100)
                     ])),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('is_superuser', models.BooleanField(default=False)),
                ('timezone',
                 models.CharField(blank=True, max_length=32, null=True)),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to='profile_images')),
                ('last_login', models.DateTimeField(blank=True, null=True)),
                ('date_joined', models.DateTimeField(auto_now_add=True)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'ordering': ('username', ),
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AddIndex(
            model_name='user',
            index=models.Index(fields=['username'],
                               name='accounts_us_usernam_c0ea66_idx'),
        ),
        migrations.AddIndex(
            model_name='user',
            index=models.Index(fields=['email'],
                               name='accounts_us_email_74c8d6_idx'),
        ),
        migrations.AddConstraint(
            model_name='user',
            constraint=models.CheckConstraint(check=models.Q(
                ('daily_progress__gte', 0), ('daily_progress__lte', 100)),
                                              name='valid_daily_progress'),
        ),
    ]
예제 #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('mainapp', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name',
                 models.CharField(max_length=40,
                                  unique=True,
                                  verbose_name='name')),
                ('category',
                 models.ForeignKey(
                     blank=True,
                     limit_choices_to={'category__isnull': True},
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='categories',
                     to='shop.category',
                     verbose_name='parent category')),
                ('content_type',
                 models.ForeignKey(limit_choices_to={
                     'app_label': 'shop',
                     'model__endswith': 'product'
                 },
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='contenttypes.contenttype')),
            ],
            options={
                'verbose_name_plural': 'categories',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('status',
                 models.PositiveIntegerField(
                     choices=[(1, 'Cart'), (2, 'Processing'), (
                         3, 'Shipping'), (4, 'Finished'), (5, 'Canceled')])),
                ('address', models.TextField(blank=True)),
                ('order_cost',
                 models.DecimalField(
                     decimal_places=2,
                     default=Decimal('0'),
                     max_digits=9,
                     validators=[
                         django.core.validators.MinValueValidator(Decimal('0'))
                     ])),
                ('reserved', models.BooleanField(default=False)),
                ('order_date', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ['-id'],
            },
        ),
        migrations.CreateModel(
            name='Account',
            fields=[],
            options={
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=('mainapp.customuser', ),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='TvProduct',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name', models.CharField(max_length=40)),
                ('marking',
                 models.CharField(
                     help_text='Model or the main feature of the product.',
                     max_length=40)),
                ('image',
                 models.ImageField(
                     help_text=
                     'Minimal image sizes is 600x600 pixels. Max upload file size up to 3 MB.',
                     upload_to=shop.services.get_file_directory_path,
                     validators=[shop.services.validate_image_size])),
                ('description', models.TextField(blank=True)),
                ('unit',
                 models.CharField(choices=[
                     ('Weight', (('KG', 'kilo'), ('LB', 'pound'))),
                     ('Volume', (('L', 'liter'), ('GAL', 'gallon'))),
                     ('PC', 'piece'), ('PCK', 'pack'), ('PR', 'pair'),
                     ('BTL', 'bottle'), ('LT', 'lot')
                 ],
                                  default='PC',
                                  max_length=3)),
                ('unit_for_weight_vol',
                 models.CharField(choices=[
                     ('Weight', (('KG', 'kilo'), ('LB', 'pound'))),
                     ('Volume', (('L', 'liter'), ('GAL', 'gallon'))),
                     ('PC', 'piece'), ('PCK', 'pack'), ('PR', 'pair'),
                     ('BTL', 'bottle'), ('LT', 'lot')
                 ],
                                  default='KG',
                                  max_length=3,
                                  verbose_name='unit for weight/volume')),
                ('date_added', models.DateField(auto_now_add=True)),
                ('screen_diagonal', models.CharField(max_length=10)),
                ('screen_resolution', models.CharField(max_length=20)),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   related_name='+',
                                   to='shop.category')),
            ],
            options={
                'verbose_name': 'TV',
                'ordering': ['-date_added'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Specification',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('tag', models.CharField(blank=True, max_length=20)),
                ('image',
                 models.ImageField(
                     blank=True,
                     help_text=
                     'Minimal image sizes is 600x600 pixels. Max upload file size up to 3 MB.',
                     upload_to=shop.services.get_file_directory_path,
                     validators=[shop.services.validate_image_size])),
                ('pre_packing',
                 models.DecimalField(
                     decimal_places=3,
                     default='1',
                     max_digits=6,
                     validators=[
                         django.core.validators.MinValueValidator(
                             Decimal('0.001'))
                     ],
                     verbose_name='pre-packing')),
                ('weight_vol',
                 models.DecimalField(
                     decimal_places=3,
                     max_digits=6,
                     validators=[
                         django.core.validators.MinValueValidator(
                             Decimal('0.001'))
                     ],
                     verbose_name='weight/volume')),
                ('price',
                 models.DecimalField(
                     decimal_places=2,
                     max_digits=9,
                     validators=[
                         django.core.validators.MinValueValidator(
                             Decimal('0.01'))
                     ])),
                ('discount',
                 models.IntegerField(
                     default=0,
                     help_text='A discount from 0 to 99%.',
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(99)
                     ])),
                ('discount_price',
                 models.DecimalField(decimal_places=2,
                                     default=Decimal('0'),
                                     editable=False,
                                     max_digits=9)),
                ('sale_price',
                 models.DecimalField(
                     decimal_places=2,
                     default=Decimal('0'),
                     help_text=
                     'Special price replaces the discount price, 0 is disabled',
                     max_digits=9,
                     validators=[
                         django.core.validators.MinValueValidator(Decimal('0'))
                     ])),
                ('available_qty',
                 models.DecimalField(
                     decimal_places=3,
                     max_digits=6,
                     validators=[
                         django.core.validators.MinValueValidator(Decimal('0'))
                     ],
                     verbose_name='available quantity')),
                ('addition',
                 models.CharField(blank=True,
                                  max_length=100,
                                  verbose_name='additional information')),
                ('date_added', models.DateField(auto_now_add=True)),
                ('object_id', models.PositiveIntegerField()),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   related_name='specs',
                                   to='shop.category')),
                ('content_type',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='contenttypes.contenttype')),
            ],
        ),
        migrations.CreateModel(
            name='SmartphoneProduct',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name', models.CharField(max_length=40)),
                ('marking',
                 models.CharField(
                     help_text='Model or the main feature of the product.',
                     max_length=40)),
                ('image',
                 models.ImageField(
                     help_text=
                     'Minimal image sizes is 600x600 pixels. Max upload file size up to 3 MB.',
                     upload_to=shop.services.get_file_directory_path,
                     validators=[shop.services.validate_image_size])),
                ('description', models.TextField(blank=True)),
                ('unit',
                 models.CharField(choices=[
                     ('Weight', (('KG', 'kilo'), ('LB', 'pound'))),
                     ('Volume', (('L', 'liter'), ('GAL', 'gallon'))),
                     ('PC', 'piece'), ('PCK', 'pack'), ('PR', 'pair'),
                     ('BTL', 'bottle'), ('LT', 'lot')
                 ],
                                  default='PC',
                                  max_length=3)),
                ('unit_for_weight_vol',
                 models.CharField(choices=[
                     ('Weight', (('KG', 'kilo'), ('LB', 'pound'))),
                     ('Volume', (('L', 'liter'), ('GAL', 'gallon'))),
                     ('PC', 'piece'), ('PCK', 'pack'), ('PR', 'pair'),
                     ('BTL', 'bottle'), ('LT', 'lot')
                 ],
                                  default='KG',
                                  max_length=3,
                                  verbose_name='unit for weight/volume')),
                ('date_added', models.DateField(auto_now_add=True)),
                ('ram', models.CharField(max_length=30)),
                ('memory', models.CharField(max_length=30)),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   related_name='+',
                                   to='shop.category')),
            ],
            options={
                'verbose_name': 'smartphone',
                'ordering': ['-date_added'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ShippingAddress',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('full_name', models.CharField(max_length=90)),
                ('address', models.CharField(max_length=255)),
                ('city', models.CharField(max_length=60)),
                ('region', models.CharField(max_length=60)),
                ('postcode', models.CharField(max_length=10)),
                ('country', models.CharField(max_length=60)),
                ('phone', models.CharField(max_length=20)),
                ('by_default', models.BooleanField(default=False)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='addresses',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'shipping addresses',
            },
        ),
        migrations.CreateModel(
            name='Rate',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('point',
                 models.IntegerField(choices=[(1, 'One'), (
                     2, 'Two'), (3, 'Three'), (4, 'Four'), (5, 'Five')])),
                ('review', models.TextField(blank=True)),
                ('object_id', models.PositiveIntegerField()),
                ('content_type',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='contenttypes.contenttype')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='OrderItem',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('quantity',
                 models.DecimalField(
                     decimal_places=3,
                     max_digits=6,
                     validators=[
                         django.core.validators.MinValueValidator(Decimal('0'))
                     ])),
                ('price',
                 models.DecimalField(
                     decimal_places=2,
                     max_digits=9,
                     validators=[
                         django.core.validators.MinValueValidator(
                             Decimal('0.01'))
                     ])),
                ('order',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='shop.order')),
                ('specification',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='shop.specification')),
            ],
        ),
        migrations.AddField(
            model_name='order',
            name='specs',
            field=models.ManyToManyField(through='shop.OrderItem',
                                         to='shop.Specification'),
        ),
        migrations.AddField(
            model_name='order',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='FoodProduct',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name', models.CharField(max_length=40)),
                ('marking',
                 models.CharField(
                     help_text='Model or the main feature of the product.',
                     max_length=40)),
                ('image',
                 models.ImageField(
                     help_text=
                     'Minimal image sizes is 600x600 pixels. Max upload file size up to 3 MB.',
                     upload_to=shop.services.get_file_directory_path,
                     validators=[shop.services.validate_image_size])),
                ('description', models.TextField(blank=True)),
                ('unit',
                 models.CharField(choices=[
                     ('Weight', (('KG', 'kilo'), ('LB', 'pound'))),
                     ('Volume', (('L', 'liter'), ('GAL', 'gallon'))),
                     ('PC', 'piece'), ('PCK', 'pack'), ('PR', 'pair'),
                     ('BTL', 'bottle'), ('LT', 'lot')
                 ],
                                  default='PC',
                                  max_length=3)),
                ('unit_for_weight_vol',
                 models.CharField(choices=[
                     ('Weight', (('KG', 'kilo'), ('LB', 'pound'))),
                     ('Volume', (('L', 'liter'), ('GAL', 'gallon'))),
                     ('PC', 'piece'), ('PCK', 'pack'), ('PR', 'pair'),
                     ('BTL', 'bottle'), ('LT', 'lot')
                 ],
                                  default='KG',
                                  max_length=3,
                                  verbose_name='unit for weight/volume')),
                ('date_added', models.DateField(auto_now_add=True)),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   related_name='+',
                                   to='shop.category')),
            ],
            options={
                'verbose_name': 'foodstuff',
                'ordering': ['-date_added'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ClothingProduct',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name', models.CharField(max_length=40)),
                ('marking',
                 models.CharField(
                     help_text='Model or the main feature of the product.',
                     max_length=40)),
                ('image',
                 models.ImageField(
                     help_text=
                     'Minimal image sizes is 600x600 pixels. Max upload file size up to 3 MB.',
                     upload_to=shop.services.get_file_directory_path,
                     validators=[shop.services.validate_image_size])),
                ('description', models.TextField(blank=True)),
                ('unit',
                 models.CharField(choices=[
                     ('Weight', (('KG', 'kilo'), ('LB', 'pound'))),
                     ('Volume', (('L', 'liter'), ('GAL', 'gallon'))),
                     ('PC', 'piece'), ('PCK', 'pack'), ('PR', 'pair'),
                     ('BTL', 'bottle'), ('LT', 'lot')
                 ],
                                  default='PC',
                                  max_length=3)),
                ('unit_for_weight_vol',
                 models.CharField(choices=[
                     ('Weight', (('KG', 'kilo'), ('LB', 'pound'))),
                     ('Volume', (('L', 'liter'), ('GAL', 'gallon'))),
                     ('PC', 'piece'), ('PCK', 'pack'), ('PR', 'pair'),
                     ('BTL', 'bottle'), ('LT', 'lot')
                 ],
                                  default='KG',
                                  max_length=3,
                                  verbose_name='unit for weight/volume')),
                ('date_added', models.DateField(auto_now_add=True)),
                ('type',
                 models.CharField(choices=[('M', 'Men'), ('W', 'Women'),
                                           ('K', 'Kids')],
                                  max_length=1)),
                ('size',
                 models.CharField(blank=True,
                                  choices=[('S', 'S'), ('M', 'M'), ('L', 'L'),
                                           ('XL', 'XL'), ('2X', 'XXL')],
                                  max_length=2)),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   related_name='+',
                                   to='shop.category')),
            ],
            options={
                'verbose_name': 'clothing',
                'verbose_name_plural': 'clothing',
                'ordering': ['-date_added'],
                'abstract': False,
            },
        ),
        migrations.AddIndex(
            model_name='tvproduct',
            index=django.contrib.postgres.indexes.GinIndex(
                django.contrib.postgres.search.SearchVector('name',
                                                            'marking',
                                                            config='english'),
                name='tvproduct_vector_idx'),
        ),
        migrations.AddIndex(
            model_name='specification',
            index=django.contrib.postgres.indexes.GinIndex(
                django.contrib.postgres.search.SearchVector('tag',
                                                            config='english'),
                name='shop_specification_vector_idx'),
        ),
        migrations.AddConstraint(
            model_name='specification',
            constraint=models.CheckConstraint(check=models.Q(
                ('available_qty__gte', 0)),
                                              name='qty_gte_0'),
        ),
        migrations.AddIndex(
            model_name='smartphoneproduct',
            index=django.contrib.postgres.indexes.GinIndex(
                django.contrib.postgres.search.SearchVector('name',
                                                            'marking',
                                                            config='english'),
                name='smartphoneproduct_vector_idx'),
        ),
        migrations.AddConstraint(
            model_name='shippingaddress',
            constraint=models.UniqueConstraint(condition=models.Q(
                ('by_default', True)),
                                               fields=('user', ),
                                               name='unique_default_address'),
        ),
        migrations.AddConstraint(
            model_name='rate',
            constraint=models.UniqueConstraint(fields=('user', 'object_id'),
                                               name='user_rate_unique'),
        ),
        migrations.AddConstraint(
            model_name='orderitem',
            constraint=models.UniqueConstraint(fields=('order',
                                                       'specification'),
                                               name='order_item_unique'),
        ),
        migrations.AddConstraint(
            model_name='order',
            constraint=models.UniqueConstraint(condition=models.Q(
                ('status', 1)),
                                               fields=('user', ),
                                               name='unique_user_cart'),
        ),
        migrations.AddIndex(
            model_name='foodproduct',
            index=django.contrib.postgres.indexes.GinIndex(
                django.contrib.postgres.search.SearchVector('name',
                                                            'marking',
                                                            config='english'),
                name='foodproduct_vector_idx'),
        ),
        migrations.AddIndex(
            model_name='clothingproduct',
            index=django.contrib.postgres.indexes.GinIndex(
                django.contrib.postgres.search.SearchVector('name',
                                                            'marking',
                                                            config='english'),
                name='clothingproduct_vector_idx'),
        ),
        migrations.AddIndex(
            model_name='category',
            index=django.contrib.postgres.indexes.GinIndex(
                django.contrib.postgres.search.SearchVector('name',
                                                            config='english'),
                name='shop_category_vector_idx'),
        ),
    ]
예제 #6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  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(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     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')),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Choice',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('subject',
                 models.IntegerField(choices=[(1, 'Mathematics')], null=True)),
                ('language',
                 models.IntegerField(choices=[(1, 'Russian'), (2, 'Kazakh'),
                                              (3, 'English')],
                                     null=True)),
                ('difficulty', models.PositiveIntegerField(null=True)),
                ('preferredLowestPrice',
                 models.PositiveIntegerField(null=True)),
                ('preferredHighestPrice',
                 models.PositiveIntegerField(null=True)),
                ('preferPersonalLessons', models.BooleanField(null=True)),
                ('preferredDuration', models.TimeField()),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('description', models.TextField(blank=True, max_length=256)),
                ('progress', models.PositiveIntegerField(default=0)),
                ('choice',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to='backend.choice')),
            ],
        ),
        migrations.CreateModel(
            name='Material',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('subject', models.IntegerField(choices=[(1, 'Mathematics')])),
                ('language',
                 models.IntegerField(
                     choices=[(1, 'Russian'), (2, 'Kazakh'), (3, 'English')])),
                ('difficulty', models.PositiveIntegerField()),
                ('price', models.PositiveIntegerField()),
                ('duration', models.TimeField()),
                ('date', models.DateField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='TimeSlot',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('day',
                 models.PositiveIntegerField(
                     choices=[(1, 'Monday'), (2, 'Tuesday'), (
                         3, 'Wednesday'), (4, 'Thursday'), (
                             5, 'Friday'), (6, 'Saturday'), (7, 'Sunday')])),
                ('start', models.TimeField()),
                ('end', models.TimeField()),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Teacher',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('bio', models.TextField(max_length=10000)),
                ('schedule',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.DateTimeField(), size=None)),
                ('subject', models.IntegerField(choices=[(1, 'Mathematics')])),
                ('language',
                 models.IntegerField(
                     choices=[(1, 'Russian'), (2, 'Kazakh'), (3, 'English')])),
                ('User',
                 models.OneToOneField(
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('edu_level',
                 models.IntegerField(choices=[(1,
                                               'Low'), (2,
                                                        'Middle'), (3,
                                                                    'High')])),
                ('User',
                 models.OneToOneField(
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Specialization',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('experience', models.PositiveIntegerField()),
                ('material',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='backend.material')),
                ('teacher',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='backend.teacher')),
            ],
        ),
        migrations.AddField(
            model_name='material',
            name='creator',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='backend.teacher'),
        ),
        migrations.CreateModel(
            name='Lesson',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('start_time', models.DateTimeField()),
                ('duration', models.TimeField()),
                ('meeting_link', models.URLField(null=True)),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='backend.course')),
                ('teacher',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='backend.teacher')),
            ],
        ),
        migrations.CreateModel(
            name='Files',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('file', models.FileField(upload_to='')),
                ('material',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='backend.material')),
            ],
        ),
        migrations.AddField(
            model_name='course',
            name='material',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                to='backend.material'),
        ),
        migrations.AddField(
            model_name='choice',
            name='student',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='backend.student'),
        ),
        migrations.AddConstraint(
            model_name='timeslot',
            constraint=models.CheckConstraint(check=models.Q(
                start__lte=django.db.models.expressions.F('end')),
                                              name='endIsLaterThanStart'),
        ),
        migrations.AddConstraint(
            model_name='choice',
            constraint=models.CheckConstraint(
                check=models.Q(preferredLowestPrice__lte=django.db.models.
                               expressions.F('preferredHighestPrice')),
                name='preferredLowestifLowestThanHighest'),
        ),
    ]
예제 #7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("auth", "0012_alter_user_first_name_max_length"),
    ]

    operations = [
        migrations.CreateModel(
            name="User",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        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(
                        error_messages={
                            "unique":
                            "A user with that username already exists."
                        },
                        help_text=
                        "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
                        max_length=150,
                        unique=True,
                        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"),
                ),
                ("token",
                 models.CharField(blank=True, max_length=500, null=True)),
                ("admin", models.BooleanField(blank=True, null=True)),
                (
                    "groups",
                    models.ManyToManyField(
                        blank=True,
                        help_text=
                        "The groups this user belongs to. A user will get all permissions granted to each of their groups.",
                        related_name="user_set",
                        related_query_name="user",
                        to="auth.Group",
                        verbose_name="groups",
                    ),
                ),
                (
                    "user_permissions",
                    models.ManyToManyField(
                        blank=True,
                        help_text="Specific permissions for this user.",
                        related_name="user_set",
                        related_query_name="user",
                        to="auth.Permission",
                        verbose_name="user permissions",
                    ),
                ),
            ],
            options={
                "verbose_name": "user",
                "verbose_name_plural": "users",
                "abstract": False,
            },
            managers=[
                ("objects", django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name="Schema",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(blank=True,
                                          max_length=500,
                                          null=True)),
                ("version", models.PositiveIntegerField()),
                (
                    "description",
                    models.CharField(blank=True, max_length=5000, null=True),
                ),
                ("csv", models.FileField(blank=True, null=True, upload_to="")),
                (
                    "user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="schemas",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Block",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("nav", models.CharField(blank=True,
                                         max_length=5000,
                                         null=True)),
                (
                    "help_text",
                    models.CharField(blank=True,
                                     help_text="AKA help",
                                     max_length=5000,
                                     null=True),
                ),
                (
                    "display_text",
                    models.CharField(blank=True,
                                     help_text="AKA title",
                                     max_length=5000,
                                     null=True),
                ),
                (
                    "example_text",
                    models.CharField(blank=True,
                                     help_text="AKA example",
                                     max_length=5000,
                                     null=True),
                ),
                (
                    "block_type",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("page-heading", "Page Heading"),
                            ("section-heading", "Section Heading"),
                            ("subsection-heading", "Subsection Heading"),
                            ("paragraph", "Paragraph"),
                            ("question-label", "Question Label"),
                            ("short-text-input", "Short Text Input"),
                            ("long-text-input", "Long Text Input"),
                            ("file-input", "File Input"),
                            ("contributors-input", "Contributors Input"),
                            ("single-select-input", "Single Select Input"),
                            ("multi-select-input", "Multi-select Input"),
                            ("select-input-option", "Select Input Option"),
                            ("select-other-option", "Select Other Option"),
                        ],
                        max_length=50000,
                        null=True,
                    ),
                ),
                (
                    "options",
                    django.contrib.postgres.fields.ArrayField(
                        base_field=models.CharField(max_length=100),
                        blank=True,
                        help_text="Enter as comma separated list",
                        null=True,
                        size=None,
                    ),
                ),
                ("required", models.BooleanField(null=True)),
                ("index", models.PositiveIntegerField(blank=True, null=True)),
                (
                    "schema",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="blocks",
                        to="web.schema",
                    ),
                ),
            ],
        ),
        migrations.AddConstraint(
            model_name="block",
            constraint=models.CheckConstraint(
                check=models.Q(
                    models.Q(_negated=True, block_type="page-heading"),
                    models.Q(
                        ("example_text__isnull", True),
                        ("block_type", "page-heading"),
                        ("help_text__isnull", True),
                    ),
                    _connector="OR",
                ),
                name="check_page_heading",
            ),
        ),
        migrations.AddConstraint(
            model_name="block",
            constraint=models.CheckConstraint(
                check=models.Q(
                    models.Q(_negated=True, block_type="section-heading"),
                    models.Q(
                        ("example_text__isnull", True),
                        ("block_type", "section-heading"),
                        ("help_text__isnull", True),
                    ),
                    _connector="OR",
                ),
                name="check_section_heading",
            ),
        ),
        migrations.AddConstraint(
            model_name="block",
            constraint=models.CheckConstraint(
                check=models.Q(
                    models.Q(_negated=True, block_type="file-input"),
                    models.Q(
                        ("display_text__isnull", True),
                        ("example_text__isnull", True),
                        ("block_type", "file-input"),
                        ("help_text__isnull", True),
                    ),
                    _connector="OR",
                ),
                name="check_file_input",
            ),
        ),
        migrations.AlterUniqueTogether(
            name="block",
            unique_together={("schema", "index")},
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('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')),
                ('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')),
                ('user_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
                ('username', models.CharField(max_length=32, unique=True)),
                ('first_name', models.CharField(max_length=50)),
                ('last_name', models.CharField(max_length=50)),
                ('email', models.EmailField(blank=True, max_length=254, null=True)),
                ('twitter_handle', models.CharField(blank=True, max_length=15, null=True)),
                ('insta_handle', models.CharField(blank=True, max_length=30, null=True)),
                ('fb_link', models.URLField(blank=True, max_length=160, null=True)),
                ('city', models.CharField(max_length=150)),
                ('state', models.CharField(max_length=150)),
                ('bio_text', models.TextField(blank=True, max_length=500, null=True)),
                ('join_date', models.DateTimeField(auto_now_add=True)),
                ('prof_pic', models.ImageField(blank=True, null=True, upload_to=tipsyapp.models.user_directory_path)),
                ('banner_img', models.ImageField(blank=True, null=True, upload_to=tipsyapp.models.user_directory_path)),
                ('star_user', models.BooleanField(default=False)),
                ('is_private', models.BooleanField(blank=True, null=True)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
            ],
            options={
                'ordering': ['-join_date'],
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Venue',
            fields=[
                ('venue_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
                ('venue_name', models.CharField(max_length=100)),
                ('venue_type', models.CharField(choices=[('Brewery', 'Brewery'), ('Distillery', 'Distillery'), ('Winery', 'Winery')], default='brewery', max_length=30)),
                ('is_authenticated', models.BooleanField(default=False)),
                ('hours_of_operation', models.TextField(max_length=300)),
                ('web_url', models.URLField()),
                ('email', models.EmailField(max_length=254)),
                ('twitter_handle', models.CharField(blank=True, max_length=15, null=True)),
                ('insta_handle', models.CharField(blank=True, max_length=30, null=True)),
                ('fb_link', models.URLField(blank=True, max_length=160, null=True)),
                ('phone_num', models.CharField(blank=True, max_length=12, null=True)),
                ('street_address', models.CharField(max_length=150)),
                ('city', models.CharField(max_length=150)),
                ('state', models.CharField(max_length=150)),
                ('zip', models.DecimalField(blank=True, decimal_places=0, max_digits=5, null=True)),
                ('v_prof_pic', models.ImageField(blank=True, null=True, upload_to=tipsyapp.models.venue_directory_path)),
                ('v_banner_img', models.ImageField(blank=True, null=True, upload_to=tipsyapp.models.venue_directory_path)),
                ('venue_img_caption', models.CharField(blank=True, max_length=100, null=True)),
                ('tags', multiselectfield.db.fields.MultiSelectField(blank=True, choices=[('Outdoor Seating/Patio', 'Outdoor Seating/Patio'), ('Pet Friendly', 'Pet Friendly'), ('Appetizers', 'Appetizers'), ('Large Variety of Draft Beers', 'Large Variety of Draft Beers'), ('Cider Options', 'Cider Options'), ('Wine Options', 'Wine Options'), ('Trivia', 'Trivia'), ('Live Entertainment', 'Live Entertainment'), ('Knowledgable Staff', 'Knowledgable Staff'), ('Flea Markets', 'Flea Markets'), ('Beer Options', 'Beer Options'), ('Food Trucks', 'Food Trucks'), ('MUST VISIT!', 'MUST VISIT!'), ('Friendly Staff', 'Friendly Staff'), ('Indoor Seating', 'Indoor Seating'), ('Cool Vibes', 'Cool Vibes'), ('Hazy IPAs', 'Hazy IPAs'), ('NE IPAs', 'NE IPAs'), ('Sours/Goses', 'Sours/Goses'), ('Saisons', 'Saisons'), ('Lagers', 'Lagers'), ('Amber/Red Ales', 'Amber/Red Ales')], max_length=297, null=True)),
                ('join_date', models.DateTimeField(auto_now_add=True)),
                ('followers_list', models.ManyToManyField(blank=True, related_name='venue_followers', to=settings.AUTH_USER_MODEL)),
                ('venue_added_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='venue_added_by', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-join_date'],
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('post_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
                ('post_date', models.DateTimeField(auto_now_add=True)),
                ('post_img_1', models.ImageField(blank=True, null=True, upload_to=tipsyapp.models.post_directory_path)),
                ('post_text', models.TextField(blank=True, max_length=800, null=True)),
                ('post_author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='posts_by', to=settings.AUTH_USER_MODEL)),
                ('post_likers', models.ManyToManyField(blank=True, related_name='post_likers', to=settings.AUTH_USER_MODEL)),
                ('posted_to_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='posted_to_user', to=settings.AUTH_USER_MODEL)),
                ('posted_to_venue', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='posted_to_venue', to='tipsyapp.venue')),
            ],
            options={
                'ordering': ['-post_date'],
            },
        ),
        migrations.CreateModel(
            name='CheckIn',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('checkin_time', models.DateTimeField(auto_now_add=True)),
                ('checkedin_venue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='checkedin_venue', to='tipsyapp.venue')),
                ('checkin_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='checkin_user', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-checkin_time'],
            },
        ),
        migrations.AddField(
            model_name='user',
            name='posts_liked',
            field=models.ManyToManyField(blank=True, related_name='posts_liked', to='tipsyapp.Post'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'),
        ),
        migrations.AddField(
            model_name='user',
            name='users_followed_by_list',
            field=models.ManyToManyField(blank=True, related_name='followed_by', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='user',
            name='users_following_list',
            field=models.ManyToManyField(blank=True, related_name='user_follows', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='user',
            name='venues_following_list',
            field=models.ManyToManyField(blank=True, related_name='venue_follows', to='tipsyapp.Venue'),
        ),
        migrations.AddConstraint(
            model_name='post',
            constraint=models.CheckConstraint(check=models.Q(models.Q(('posted_to_user__isnull', False), ('posted_to_venue__isnull', True)), models.Q(('posted_to_user__isnull', True), ('posted_to_venue__isnull', False)), _connector='OR'), name='tipsyapp_post_post_on_user_OR_venue'),
        ),
        migrations.AddConstraint(
            model_name='post',
            constraint=models.CheckConstraint(check=models.Q(models.Q(('post_img_1__isnull', False), ('post_text__isnull', False)), models.Q(('post_img_1__isnull', True), ('post_text__isnull', False)), models.Q(('post_img_1__isnull', False), ('post_text__isnull', True)), _connector='OR'), name='tipsyapp_post_post_text_ANDOR_img'),
        ),
    ]
예제 #9
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Habit',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('startTime', models.DateTimeField()),
                ('endTime', models.DateTimeField()),
                ('dateEdited', models.DateTimeField(auto_now=True)),
                ('description', models.CharField(default='', max_length=500)),
                ('name', models.CharField(max_length=25)),
                ('dateCreated', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['-dateCreated'],
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  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(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     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')),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'ordering': ['username'],
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Track',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('dateCreated',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('state',
                 models.CharField(choices=[('D', 'Done'), ('P', 'Pending'),
                                           ('F', 'Failed')],
                                  default='P',
                                  max_length=1)),
                ('note', models.CharField(default='', max_length=300)),
                ('effectiveness',
                 models.IntegerField(
                     default=0,
                     validators=[
                         django.core.validators.MinValueValidator(1),
                         django.core.validators.MaxValueValidator(3)
                     ])),
                ('habit',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='tracks',
                                   to='HaBitsApp.habit')),
            ],
            options={
                'ordering': ['-dateCreated'],
            },
        ),
        migrations.AddField(
            model_name='habit',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='habits',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddConstraint(
            model_name='habit',
            constraint=models.CheckConstraint(
                check=models.Q(
                    startTime__lt=django.db.models.expressions.F('endTime')),
                name='habitStartTimeBelowEndTime'),
        ),
    ]
예제 #10
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, 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(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, 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')),
                ('location', models.CharField(max_length=250, null=True)),
                ('age', models.IntegerField(null=True)),
                ('virtual', models.BooleanField(default=False)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Book_Club',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=256, null=True)),
                ('virtual', models.BooleanField(default=False)),
                ('members', models.ManyToManyField(related_name='book_clubs', to=settings.AUTH_USER_MODEL, verbose_name='Members of the club')),
                ('virtual_member', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='virtual_member_of', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Books',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=5125)),
                ('year', models.IntegerField()),
                ('authors', models.CharField(max_length=5125, null=True)),
                ('book_type', models.CharField(max_length=13)),
                ('isbn', models.CharField(max_length=13, null=True)),
                ('pages', models.IntegerField()),
                ('editions', models.IntegerField()),
                ('alt_titles', models.CharField(max_length=5125, null=True)),
                ('series_str_1', models.CharField(max_length=5125, null=True)),
                ('series_str_2', models.CharField(max_length=5125, null=True)),
                ('original_lang', models.CharField(max_length=40)),
                ('original_title', models.CharField(max_length=5125, null=True)),
                ('original_year', models.IntegerField()),
                ('isfdb_rating', models.FloatField()),
                ('award_winner', models.BooleanField()),
                ('juvenile', models.BooleanField()),
                ('stand_alone', models.BooleanField()),
                ('inconsistent', models.BooleanField()),
                ('virtual', models.BooleanField()),
                ('cover_image', models.CharField(max_length=5125, null=True)),
                ('wikipedia', models.CharField(max_length=20000, null=True)),
                ('synopsis', models.CharField(max_length=20000, null=True)),
                ('note', models.CharField(max_length=5125, null=True)),
                ('general_search', django.contrib.postgres.search.SearchVectorField(null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Contents',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('book_title_id', models.IntegerField()),
                ('content_title_id', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Isbns',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('isbn', models.CharField(max_length=13)),
                ('title_id', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='More_Images',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title_id', models.IntegerField()),
                ('image', models.CharField(max_length=5125)),
            ],
        ),
        migrations.CreateModel(
            name='Translations',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('lowest_title_id', models.IntegerField()),
                ('title', models.CharField(max_length=5125)),
                ('year', models.IntegerField()),
                ('note', models.CharField(max_length=20000)),
            ],
        ),
        migrations.CreateModel(
            name='Words',
            fields=[
                ('word', models.CharField(max_length=5125, primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rating', models.FloatField(null=True)),
                ('predicted_rating', models.FloatField(null=True)),
                ('original_rating', models.FloatField(null=True)),
                ('original_min', models.FloatField(null=True)),
                ('original_max', models.FloatField(null=True)),
                ('saved', models.BooleanField(default=False)),
                ('blocked', models.BooleanField(default=False)),
                ('last_updated', models.DateTimeField(default=django.utils.timezone.now)),
                ('book', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, to='recsys.books')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Meeting',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(null=True)),
                ('book', models.ForeignKey(db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='recsys.books')),
                ('book_club', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='recsys.book_club')),
            ],
        ),
        migrations.CreateModel(
            name='DataProblem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('problem', models.CharField(max_length=32768)),
                ('book', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, to='recsys.books')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddIndex(
            model_name='rating',
            index=models.Index(fields=['book'], name='recsys_rati_book_id_518aef_idx'),
        ),
        migrations.AddIndex(
            model_name='rating',
            index=models.Index(fields=['user'], name='recsys_rati_user_id_b5734a_idx'),
        ),
        migrations.AddIndex(
            model_name='rating',
            index=models.Index(fields=['rating'], name='recsys_rati_rating_5905fe_idx'),
        ),
        migrations.AddIndex(
            model_name='rating',
            index=models.Index(django.db.models.expressions.Func('rating', function='FLOOR'), name='floor_rating_idx'),
        ),
        migrations.AddIndex(
            model_name='rating',
            index=models.Index(fields=['predicted_rating'], name='recsys_rati_predict_c6b28b_idx'),
        ),
        migrations.AddIndex(
            model_name='rating',
            index=models.Index(django.db.models.expressions.Func('predicted_rating', function='FLOOR'), name='floor_predicted_rating_idx'),
        ),
        migrations.AddIndex(
            model_name='rating',
            index=models.Index(fields=['saved'], name='recsys_rati_saved_c7dd82_idx'),
        ),
        migrations.AddIndex(
            model_name='rating',
            index=models.Index(fields=['blocked'], name='recsys_rati_blocked_750ccc_idx'),
        ),
        migrations.AddIndex(
            model_name='rating',
            index=models.Index(fields=['last_updated'], name='recsys_rati_last_up_0eed51_idx'),
        ),
        migrations.AddConstraint(
            model_name='rating',
            constraint=models.UniqueConstraint(fields=('book', 'user'), name='OneRatingPerBookAndUser'),
        ),
        migrations.AddConstraint(
            model_name='rating',
            constraint=models.CheckConstraint(check=models.Q(('rating__gte', 1)), name='RatingAtLeast1'),
        ),
        migrations.AddConstraint(
            model_name='rating',
            constraint=models.CheckConstraint(check=models.Q(('rating__lte', 10)), name='RatingAtMost10'),
        ),
        migrations.AddConstraint(
            model_name='rating',
            constraint=models.CheckConstraint(check=models.Q(('original_rating__gte', django.db.models.expressions.F('original_min'))), name='OriginalRatingAtLeastMin'),
        ),
        migrations.AddConstraint(
            model_name='rating',
            constraint=models.CheckConstraint(check=models.Q(('original_rating__lte', django.db.models.expressions.F('original_max'))), name='OriginalRatingAtMostMax'),
        ),
        migrations.AddIndex(
            model_name='meeting',
            index=models.Index(fields=['book_club'], name='recsys_meet_book_cl_0ad746_idx'),
        ),
        migrations.AddIndex(
            model_name='meeting',
            index=models.Index(fields=['book'], name='recsys_meet_book_id_6789a6_idx'),
        ),
        migrations.AddIndex(
            model_name='meeting',
            index=models.Index(fields=['date'], name='recsys_meet_date_2bc3c4_idx'),
        ),
        migrations.AddIndex(
            model_name='dataproblem',
            index=models.Index(fields=['book'], name='recsys_data_book_id_3e8f3f_idx'),
        ),
        migrations.AddIndex(
            model_name='dataproblem',
            index=models.Index(fields=['user'], name='recsys_data_user_id_ffc661_idx'),
        ),
        migrations.AddIndex(
            model_name='book_club',
            index=models.Index(fields=['name'], name='recsys_book_name_7d08cf_idx'),
        ),
        migrations.AddIndex(
            model_name='book_club',
            index=models.Index(fields=['virtual'], name='recsys_book_virtual_5362e6_idx'),
        ),
        migrations.AddIndex(
            model_name='user',
            index=models.Index(fields=['username'], name='recsys_user_usernam_bbfef3_idx'),
        ),
        migrations.AddIndex(
            model_name='user',
            index=models.Index(fields=['first_name'], name='recsys_user_first_n_272cb6_idx'),
        ),
    ]
예제 #11
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='Campus',
            fields=[
                ('id', models.CharField(max_length=45, primary_key=True, serialize=False, validators=[django.core.validators.MinLengthValidator(1)])),
                ('name', models.CharField(max_length=45, validators=[django.core.validators.MinLengthValidator(1)])),
                ('address', models.CharField(max_length=45, validators=[django.core.validators.MinLengthValidator(1)])),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Class',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=45, validators=[django.core.validators.MinLengthValidator(1)])),
                ('begin_time', school_affair.field.YMField(max_length=7)),
                ('grade', models.IntegerField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.CharField(max_length=45, primary_key=True, serialize=False, validators=[django.core.validators.MinLengthValidator(1)])),
                ('name', models.CharField(max_length=45, validators=[django.core.validators.MinLengthValidator(1)])),
                ('examination', models.CharField(choices=[('exam', '考试'), ('query', '当堂答辩')], max_length=10)),
                ('start_year', models.IntegerField()),
                ('start_semester', models.CharField(choices=[('spring', '春'), ('fall', '秋')], max_length=10)),
                ('course_time', models.CharField(max_length=45, validators=[django.core.validators.MinLengthValidator(1)])),
            ],
        ),
        migrations.CreateModel(
            name='Major',
            fields=[
                ('id', models.CharField(max_length=45, primary_key=True, serialize=False, validators=[django.core.validators.MinLengthValidator(1)])),
                ('name', models.CharField(max_length=45, validators=[django.core.validators.MinLengthValidator(1)])),
                ('address', models.CharField(max_length=45, validators=[django.core.validators.MinLengthValidator(1)])),
                ('campus_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='school_affair.Campus')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('class_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='school_affair.Class')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Student_teacher',
            fields=[
                ('id', models.CharField(max_length=45, primary_key=True, serialize=False, validators=[django.core.validators.MinLengthValidator(1)])),
                ('id_number', models.CharField(max_length=45, unique=True, validators=[django.core.validators.MinLengthValidator(1)])),
                ('id_number_type', models.CharField(choices=[('ID card', '省份证'), ('pass port', '护照')], max_length=20, validators=[django.core.validators.MinLengthValidator(1)])),
                ('name_chinese', models.CharField(max_length=45, validators=[django.core.validators.MinLengthValidator(1)])),
                ('gender', models.CharField(choices=[('M', '男'), ('F', '女')], max_length=20, validators=[django.core.validators.MinLengthValidator(1)])),
                ('born_date', school_affair.field.BirthField()),
                ('nationality', models.CharField(max_length=45, validators=[django.core.validators.MinLengthValidator(1)])),
                ('email', models.EmailField(max_length=254)),
                ('student_or_teacher', models.CharField(choices=[('student', '学生'), ('teacher', '教师')], max_length=10, validators=[django.core.validators.MinLengthValidator(1)])),
                ('entry_data', school_affair.field.YMField(max_length=7)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Teacher',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('professional_title', models.CharField(blank=True, choices=[('professor', '教授'), ('associate professor', '副教授')], max_length=20, null=True)),
                ('major_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='school_affair.Major')),
                ('sup', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='school_affair.Student_teacher')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Student_unnormal_change',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('data', school_affair.field.YMField(max_length=7)),
                ('change_type', models.CharField(choices=[('tranfer', '转专业'), ('downward', '降级')], max_length=10)),
                ('class_after', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='after', to='school_affair.Class')),
                ('class_before', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='before', to='school_affair.Class')),
                ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='school_affair.Student')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='student',
            name='sup',
            field=models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='school_affair.Student_teacher'),
        ),
        migrations.CreateModel(
            name='Major_transfer',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('youth_league_changed', models.CharField(choices=[('yes', '是'), ('no', '不是'), ('not a', '不是团员')], max_length=5)),
                ('sup', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='school_affair.Student_unnormal_change')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='major',
            name='person_in_cahrge',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='school_affair.Teacher'),
        ),
        migrations.CreateModel(
            name='Home_information',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('home_address', models.CharField(max_length=45, validators=[django.core.validators.MinLengthValidator(1)])),
                ('post_code', models.CharField(max_length=45, validators=[django.core.validators.MinLengthValidator(1)])),
                ('home_telephone_number', models.CharField(max_length=45, validators=[django.core.validators.MinLengthValidator(1)])),
                ('sup', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='school_affair.Student_teacher')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Grade_downward',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('cause', models.CharField(choices=[('suspend', '休学'), ('teacher', '支教')], max_length=10)),
                ('sup', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='school_affair.Student_unnormal_change')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Course_sign_up',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('score', models.IntegerField(blank=True, null=True)),
                ('course_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='school_affair.Course')),
                ('student_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='school_affair.Student')),
            ],
        ),
        migrations.AddField(
            model_name='course',
            name='major_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='school_affair.Major'),
        ),
        migrations.AddField(
            model_name='course',
            name='teacher_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='school_affair.Teacher'),
        ),
        migrations.AddField(
            model_name='class',
            name='header_teacher',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='school_affair.Teacher'),
        ),
        migrations.AddField(
            model_name='class',
            name='major_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='school_affair.Major'),
        ),
        migrations.CreateModel(
            name='school_user',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, 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(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, 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')),
                ('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')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('person', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='school_affair.Student_teacher')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.AddConstraint(
            model_name='course_sign_up',
            constraint=models.UniqueConstraint(fields=('course_id', 'student_id'), name='no duplicated sign-up'),
        ),
        migrations.AddConstraint(
            model_name='course',
            constraint=models.CheckConstraint(check=models.Q(start_year__gte=1960), name='past'),
        ),
    ]
예제 #12
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     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(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     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')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Friendship',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now=True)),
                ('initiator',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('partner',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='friendships_partner',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='user',
            name='friends',
            field=models.ManyToManyField(related_name='_users_user_friends_+',
                                         through='users.Friendship',
                                         to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='user',
            name='groups',
            field=models.ManyToManyField(
                blank=True,
                help_text=
                'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Group',
                verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(
                blank=True,
                help_text='Specific permissions for this user.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Permission',
                verbose_name='user permissions'),
        ),
        migrations.AddConstraint(
            model_name='friendship',
            constraint=models.UniqueConstraint(
                fields=('initiator', 'partner'),
                name='unique_initiator_partner_constraint'),
        ),
        migrations.AddConstraint(
            model_name='friendship',
            constraint=models.UniqueConstraint(
                fields=('partner', 'initiator'),
                name='unique_partner_initiator_constraint'),
        ),
        migrations.AddConstraint(
            model_name='friendship',
            constraint=models.CheckConstraint(
                check=models.Q(
                    ('initiator', django.db.models.expressions.F('partner')),
                    _negated=True),
                name='friendship_with_yourself_constraint'),
        ),
    ]
예제 #13
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  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(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     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')),
                ('matchday', models.IntegerField(default=1)),
                ('season', models.IntegerField(default=2020)),
                ('current_season', models.IntegerField(default=2020)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Club',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='ClubAttr',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('rank', models.IntegerField(default=20)),
                ('budget',
                 models.DecimalField(decimal_places=2,
                                     default=15.0,
                                     max_digits=5)),
                ('ovr',
                 models.IntegerField(help_text='Value between 1 and 20')),
                ('formation', models.CharField(default='4-4-2', max_length=5)),
                ('attendance',
                 models.DecimalField(decimal_places=2,
                                     default=0.5,
                                     max_digits=3)),
                ('pld', models.IntegerField(default=0)),
                ('gs', models.IntegerField(default=0)),
                ('ga', models.IntegerField(default=0)),
                ('pts', models.IntegerField(default=0)),
                ('pos', models.IntegerField(default=0)),
                ('pos_track', models.IntegerField(default=20)),
            ],
        ),
        migrations.CreateModel(
            name='ClubInfo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(help_text='Enter your team name.',
                                  max_length=50,
                                  unique=True)),
                ('primary_colour',
                 models.CharField(
                     default='#2E86C1',
                     help_text='Enter primary team colour (RGB, RGBA or HEX).',
                     max_length=25)),
                ('secondary_colour',
                 models.CharField(
                     default='#FFC300',
                     help_text=
                     'Enter secondary team colour (RGB, RGBA or HEX).',
                     max_length=25)),
                ('desc',
                 models.TextField(
                     default=
                     'Can you transform these plucky underdogs into world beaters?',
                     max_length=100)),
                ('capacity', models.IntegerField(default=22000)),
                ('user_club', models.BooleanField(default=False)),
                ('rivals',
                 models.ManyToManyField(blank=True,
                                        default=12,
                                        to='main.ClubInfo')),
            ],
        ),
        migrations.CreateModel(
            name='Fixture',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('season', models.IntegerField(default=2020)),
                ('matchday', models.IntegerField(default=1)),
                ('played', models.BooleanField(default=False)),
                ('away',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='away_fixtures',
                                   to='main.club')),
                ('home',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='home_fixtures',
                                   to='main.club')),
                ('user',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='fixtures',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['season', 'matchday', 'home'],
            },
        ),
        migrations.CreateModel(
            name='Nation',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nationality',
                 models.CharField(help_text='Enter name of country.',
                                  max_length=20,
                                  unique=True)),
                ('flag',
                 models.FileField(blank=True,
                                  help_text='Upload svg image of nation flag.',
                                  null=True,
                                  upload_to='flags')),
                ('nat_code',
                 models.CharField(
                     help_text=
                     "Enter valid <a href='https://faker.readthedocs.io/en/master/locales.html'>faker locale code</a>.",
                     max_length=5)),
            ],
        ),
        migrations.CreateModel(
            name='PlayerAttr',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('age', models.IntegerField()),
                ('speed', models.DecimalField(decimal_places=2, max_digits=4)),
                ('strength', models.DecimalField(decimal_places=2,
                                                 max_digits=4)),
                ('technique',
                 models.DecimalField(decimal_places=2, max_digits=4)),
                ('potential',
                 models.DecimalField(decimal_places=2, max_digits=4)),
                ('handsomeness',
                 models.DecimalField(decimal_places=2, max_digits=4)),
                ('value', models.DecimalField(decimal_places=2, max_digits=4)),
                ('ovr',
                 models.DecimalField(blank=True,
                                     decimal_places=1,
                                     max_digits=3,
                                     null=True)),
                ('squad_num', models.IntegerField()),
            ],
            options={
                'ordering': ['squad_num', '-value'],
            },
        ),
        migrations.CreateModel(
            name='PlayerInfo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(help_text='Enter a player name.',
                                  max_length=100)),
                ('pos',
                 models.CharField(help_text='Enter player position',
                                  max_length=3)),
                ('nation',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='main.nation')),
                ('starter_club',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='starter_players',
                                   to='main.clubinfo')),
            ],
        ),
        migrations.CreateModel(
            name='Player',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('club',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='club_players',
                                   to='main.club')),
                ('player_attr',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='player_instance',
                     to='main.playerattr')),
                ('player_info',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='player',
                     to='main.playerinfo')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='players',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='News',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('message_id', models.IntegerField()),
                ('sender', models.CharField(max_length=100)),
                ('subject', models.CharField(max_length=500)),
                ('body',
                 models.TextField(
                     default=
                     'I am a wealthy Nigerian Prince and I need some help in moving my fortune to your\n         country. I will reward you handsomely with many jewels and diamonds and monies. Please\n         reply immediately with your bank details and personal information as so to proceed.'
                 )),
                ('offer',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     default=0,
                                     max_digits=5,
                                     null=True)),
                ('read', models.BooleanField(default=False)),
                ('club',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='club_news',
                                   to='main.club')),
                ('player',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='player_news',
                                   to='main.player')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='news',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ManagerInfo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('age', models.IntegerField(default=40)),
                ('board_confidence', models.IntegerField(default=40)),
                ('user_manager', models.BooleanField(default=False)),
                ('nation',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='main.nation')),
                ('starter_club',
                 models.OneToOneField(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='starter_manager',
                     to='main.clubinfo')),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Manager',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('club',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='manager',
                     to='main.club')),
                ('manager_info',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to='main.managerinfo')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='managers',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Goal',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('minute', models.IntegerField()),
                ('fixture',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='fixture_goals',
                                   to='main.fixture')),
                ('scorer',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='goals',
                                   to='main.player')),
            ],
        ),
        migrations.AddConstraint(
            model_name='clubattr',
            constraint=models.CheckConstraint(
                check=models.Q(('ovr__gte', 0), ('ovr__lte', 20)),
                name='A value between 1 and 20 is required.'),
        ),
        migrations.AddField(
            model_name='club',
            name='club_attr',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='club_instance',
                to='main.clubattr'),
        ),
        migrations.AddField(
            model_name='club',
            name='club_info',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='club',
                to='main.clubinfo'),
        ),
        migrations.AddField(
            model_name='club',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='clubs',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='user',
            name='groups',
            field=models.ManyToManyField(
                blank=True,
                help_text=
                'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Group',
                verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(
                blank=True,
                help_text='Specific permissions for this user.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Permission',
                verbose_name='user permissions'),
        ),
    ]
예제 #14
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('quiz', '0001_initial'),
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  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')),
                ('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')),
                ('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')),
                ('email', models.EmailField(max_length=255, unique=True)),
                ('username', models.CharField(max_length=30, unique=True)),
                ('age', models.PositiveIntegerField(default=18)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='QuizUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_started', models.DateTimeField(auto_now_add=True)),
                ('date_finished', models.DateTimeField(blank=True, null=True)),
                ('good_answers', models.PositiveIntegerField(default=0)),
                ('bad_answers', models.PositiveIntegerField(default=0)),
                ('quiz',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='attempts',
                                   to='quiz.Quiz')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='users',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'QuizUser',
                'verbose_name_plural': 'QuizUsers',
            },
        ),
        migrations.CreateModel(
            name='QuestionUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('answer',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='answers',
                     to='quiz.QuestionAnswer')),
                ('question',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='quiz.Question')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'QuestionUser',
                'verbose_name_plural': 'QuestionUsers',
            },
        ),
        migrations.AddConstraint(
            model_name='user',
            constraint=models.CheckConstraint(check=models.Q(_negated=True,
                                                             username=''),
                                              name='non_empty_username'),
        ),
    ]
class Migration(migrations.Migration):

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

    operations = [
        migrations.DeleteModel(name='Album', ),
        migrations.AlterModelManagers(
            name='spotifyuser',
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.RemoveField(
            model_name='song',
            name='albumID',
        ),
        migrations.AlterField(
            model_name='artist',
            name='mainGenre',
            field=models.ForeignKey(
                db_column='mainGenre',
                on_delete=django.db.models.deletion.PROTECT,
                to='spotify.Genre'),
        ),
        migrations.AlterField(
            model_name='playlist',
            name='createdBy',
            field=models.ForeignKey(
                db_column='createdBy',
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='playlistsongs',
            name='playlistID',
            field=models.ForeignKey(
                db_column='playlistID',
                on_delete=django.db.models.deletion.CASCADE,
                to='spotify.Playlist'),
        ),
        migrations.AlterField(
            model_name='playlistsongs',
            name='songID',
            field=models.ForeignKey(
                db_column='songID',
                on_delete=django.db.models.deletion.CASCADE,
                to='spotify.Song'),
        ),
        migrations.AlterField(
            model_name='song',
            name='artist',
            field=models.ForeignKey(
                db_column='artist',
                on_delete=django.db.models.deletion.CASCADE,
                to='spotify.Artist'),
        ),
        migrations.AlterField(
            model_name='song',
            name='genreID',
            field=models.ForeignKey(
                db_column='genreID',
                on_delete=django.db.models.deletion.PROTECT,
                to='spotify.Genre'),
        ),
        migrations.AlterField(
            model_name='userfollow',
            name='artist',
            field=models.ForeignKey(
                db_column='artist',
                on_delete=django.db.models.deletion.CASCADE,
                to='spotify.Artist'),
        ),
        migrations.AlterField(
            model_name='userfollow',
            name='username',
            field=models.ForeignKey(
                db_column='username',
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='userlikes',
            name='songID',
            field=models.ForeignKey(
                db_column='songID',
                on_delete=django.db.models.deletion.CASCADE,
                to='spotify.Song'),
        ),
        migrations.AlterField(
            model_name='userlikes',
            name='username',
            field=models.ForeignKey(
                db_column='username',
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddConstraint(
            model_name='artist',
            constraint=models.CheckConstraint(check=models.Q(_negated=True,
                                                             artistName=''),
                                              name='artistName_not_blank'),
        ),
        migrations.AddConstraint(
            model_name='genre',
            constraint=models.CheckConstraint(check=models.Q(_negated=True,
                                                             genre=''),
                                              name='genre_not_blank'),
        ),
        migrations.AddConstraint(
            model_name='playlist',
            constraint=models.CheckConstraint(check=models.Q(_negated=True,
                                                             playlistName=''),
                                              name='playlistName_not_blank'),
        ),
        migrations.AddConstraint(
            model_name='song',
            constraint=models.CheckConstraint(check=models.Q(_negated=True,
                                                             title=''),
                                              name='title_not_blank'),
        ),
        migrations.AddConstraint(
            model_name='spotifyuser',
            constraint=models.CheckConstraint(check=models.Q(
                models.Q(_negated=True, username=''),
                models.Q(_negated=True, username__contains=' ')),
                                              name='username_not_blank'),
        ),
        migrations.AddConstraint(
            model_name='spotifyuser',
            constraint=models.CheckConstraint(check=models.Q(_negated=True,
                                                             firstName=''),
                                              name='firstName_not_blank'),
        ),
        migrations.AddConstraint(
            model_name='spotifyuser',
            constraint=models.CheckConstraint(check=models.Q(
                models.Q(_negated=True, password=''),
                models.Q(_negated=True, password__contains=' ')),
                                              name='password_not_blank'),
        ),
    ]