Pyupgrade in common/djangoapps/coursemodes.

This commit is contained in:
Awais Qureshi
2021-03-18 11:19:46 +05:00
parent 3b65406a0d
commit 356f169a47
27 changed files with 134 additions and 168 deletions

View File

@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import migrations, models
from opaque_keys.edx.django.models import CourseKeyField
@@ -19,12 +16,12 @@ class Migration(migrations.Migration):
('mode_slug', models.CharField(max_length=100, verbose_name='Mode')),
('mode_display_name', models.CharField(max_length=255, verbose_name='Display Name')),
('min_price', models.IntegerField(default=0, verbose_name='Price')),
('currency', models.CharField(default=u'usd', max_length=8)),
('currency', models.CharField(default='usd', max_length=8)),
('expiration_datetime', models.DateTimeField(default=None, help_text='OPTIONAL: After this date/time, users will no longer be able to enroll in this mode. Leave this blank if users can enroll in this mode until enrollment closes for the course.', null=True, verbose_name='Upgrade Deadline', blank=True)),
('expiration_date', models.DateField(default=None, null=True, blank=True)),
('suggested_prices', models.CommaSeparatedIntegerField(default=u'', max_length=255, blank=True)),
('suggested_prices', models.CommaSeparatedIntegerField(default='', max_length=255, blank=True)),
('description', models.TextField(null=True, blank=True)),
('sku', models.CharField(help_text='OPTIONAL: This is the SKU (stock keeping unit) of this mode in the external ecommerce service. Leave this blank if the course has not yet been migrated to the ecommerce service.', max_length=255, null=True, verbose_name=u'SKU', blank=True)),
('sku', models.CharField(help_text='OPTIONAL: This is the SKU (stock keeping unit) of this mode in the external ecommerce service. Leave this blank if the course has not yet been migrated to the ecommerce service.', max_length=255, null=True, verbose_name='SKU', blank=True)),
],
),
migrations.CreateModel(
@@ -35,14 +32,14 @@ class Migration(migrations.Migration):
('mode_slug', models.CharField(max_length=100)),
('mode_display_name', models.CharField(max_length=255)),
('min_price', models.IntegerField(default=0)),
('suggested_prices', models.CommaSeparatedIntegerField(default=u'', max_length=255, blank=True)),
('currency', models.CharField(default=u'usd', max_length=8)),
('suggested_prices', models.CommaSeparatedIntegerField(default='', max_length=255, blank=True)),
('currency', models.CharField(default='usd', max_length=8)),
('expiration_date', models.DateField(default=None, null=True, blank=True)),
('expiration_datetime', models.DateTimeField(default=None, null=True, blank=True)),
],
),
migrations.AlterUniqueTogether(
name='coursemode',
unique_together=set([('course_id', 'mode_slug', 'currency')]),
unique_together={('course_id', 'mode_slug', 'currency')},
),
]

View File

@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import migrations, models

View File

@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import migrations, models

View File

@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from datetime import timedelta
import django.db.models.deletion

View File

@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import migrations, models
@@ -21,7 +18,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='coursemode',
name='_expiration_datetime',
field=models.DateTimeField(db_column=u'expiration_datetime', default=None, blank=True, help_text='OPTIONAL: After this date/time, users will no longer be able to enroll in this mode. Leave this blank if users can enroll in this mode until enrollment closes for the course.', null=True, verbose_name='Upgrade Deadline'),
field=models.DateTimeField(db_column='expiration_datetime', default=None, blank=True, help_text='OPTIONAL: After this date/time, users will no longer be able to enroll in this mode. Leave this blank if users can enroll in this mode until enrollment closes for the course.', null=True, verbose_name='Upgrade Deadline'),
),
]
)

View File

@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import migrations, models

View File

@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import migrations, models
@@ -14,6 +11,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='coursemode',
name='bulk_sku',
field=models.CharField(default=None, max_length=255, blank=True, help_text='This is the bulk SKU (stock keeping unit) of this mode in the external ecommerce service.', null=True, verbose_name=u'Bulk SKU'),
field=models.CharField(default=None, max_length=255, blank=True, help_text='This is the bulk SKU (stock keeping unit) of this mode in the external ecommerce service.', null=True, verbose_name='Bulk SKU'),
),
]

View File

@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import migrations, models
from opaque_keys.edx.django.models import CourseKeyField
@@ -52,6 +49,6 @@ class Migration(migrations.Migration):
# since the database column constraint already exists).
migrations.AlterUniqueTogether(
name='coursemode',
unique_together=set([('course', 'mode_slug', 'currency')]),
unique_together={('course', 'mode_slug', 'currency')},
),
]

View File

@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
import re
import django.core.validators
@@ -17,6 +14,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='coursemode',
name='suggested_prices',
field=models.CharField(default=u'', max_length=255, blank=True, validators=[django.core.validators.RegexValidator(re.compile('^[\\d,]+\\Z'), 'Enter only digits separated by commas.', 'invalid')]),
field=models.CharField(default='', max_length=255, blank=True, validators=[django.core.validators.RegexValidator(re.compile('^[\\d,]+\\Z'), 'Enter only digits separated by commas.', 'invalid')]),
),
]

View File

@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
import re
import django.core.validators
@@ -17,6 +14,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='coursemodesarchive',
name='suggested_prices',
field=models.CharField(default=u'', max_length=255, blank=True, validators=[django.core.validators.RegexValidator(re.compile('^[\\d,]+\\Z'), 'Enter only digits separated by commas.', 'invalid')]),
field=models.CharField(default='', max_length=255, blank=True, validators=[django.core.validators.RegexValidator(re.compile('^[\\d,]+\\Z'), 'Enter only digits separated by commas.', 'invalid')]),
),
]

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-01-30 17:38
@@ -18,11 +17,11 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='coursemode',
name='suggested_prices',
field=models.CharField(blank=True, default=u'', max_length=255, validators=[django.core.validators.RegexValidator(re.compile('^\d+(?:{escaped_comma}\d+)*\Z'.format(escaped_comma=re.escape(','))), code='invalid', message='Enter only digits separated by commas.')]),
field=models.CharField(blank=True, default='', max_length=255, validators=[django.core.validators.RegexValidator(re.compile(r'^\d+(?:{escaped_comma}\d+)*\Z'.format(escaped_comma=re.escape(','))), code='invalid', message='Enter only digits separated by commas.')]),
),
migrations.AlterField(
model_name='coursemodesarchive',
name='suggested_prices',
field=models.CharField(blank=True, default=u'', max_length=255, validators=[django.core.validators.RegexValidator(re.compile('^\d+(?:{escaped_comma}\d+)*\Z'.format(escaped_comma=re.escape(','))), code='invalid', message='Enter only digits separated by commas.')]),
field=models.CharField(blank=True, default='', max_length=255, validators=[django.core.validators.RegexValidator(re.compile(r'^\d+(?:{escaped_comma}\d+)*\Z'.format(escaped_comma=re.escape(','))), code='invalid', message='Enter only digits separated by commas.')]),
),
]

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.21 on 2019-06-19 01:31
@@ -26,14 +25,14 @@ class Migration(migrations.Migration):
('mode_slug', models.CharField(max_length=100, verbose_name='Mode')),
('mode_display_name', models.CharField(max_length=255, verbose_name='Display Name')),
('min_price', models.IntegerField(default=0, verbose_name='Price')),
('currency', models.CharField(default=u'usd', max_length=8)),
('_expiration_datetime', models.DateTimeField(blank=True, db_column=u'expiration_datetime', default=None, help_text='OPTIONAL: After this date/time, users will no longer be able to enroll in this mode. Leave this blank if users can enroll in this mode until enrollment closes for the course.', null=True, verbose_name='Upgrade Deadline')),
('currency', models.CharField(default='usd', max_length=8)),
('_expiration_datetime', models.DateTimeField(blank=True, db_column='expiration_datetime', default=None, help_text='OPTIONAL: After this date/time, users will no longer be able to enroll in this mode. Leave this blank if users can enroll in this mode until enrollment closes for the course.', null=True, verbose_name='Upgrade Deadline')),
('expiration_datetime_is_explicit', models.BooleanField(default=False)),
('expiration_date', models.DateField(blank=True, default=None, null=True)),
('suggested_prices', models.CharField(blank=True, default=u'', max_length=255, validators=[django.core.validators.RegexValidator(re.compile('^\\d+(?:{escaped_comma}\\d+)*\\Z'.format(escaped_comma=re.escape(','))), code='invalid', message='Enter only digits separated by commas.')])),
('suggested_prices', models.CharField(blank=True, default='', max_length=255, validators=[django.core.validators.RegexValidator(re.compile('^\\d+(?:{escaped_comma}\\d+)*\\Z'.format(escaped_comma=re.escape(','))), code='invalid', message='Enter only digits separated by commas.')])),
('description', models.TextField(blank=True, null=True)),
('sku', models.CharField(blank=True, help_text='OPTIONAL: This is the SKU (stock keeping unit) of this mode in the external ecommerce service. Leave this blank if the course has not yet been migrated to the ecommerce service.', max_length=255, null=True, verbose_name=u'SKU')),
('bulk_sku', models.CharField(blank=True, default=None, help_text='This is the bulk SKU (stock keeping unit) of this mode in the external ecommerce service.', max_length=255, null=True, verbose_name=u'Bulk SKU')),
('sku', models.CharField(blank=True, help_text='OPTIONAL: This is the SKU (stock keeping unit) of this mode in the external ecommerce service. Leave this blank if the course has not yet been migrated to the ecommerce service.', max_length=255, null=True, verbose_name='SKU')),
('bulk_sku', models.CharField(blank=True, default=None, help_text='This is the bulk SKU (stock keeping unit) of this mode in the external ecommerce service.', max_length=255, null=True, verbose_name='Bulk SKU')),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField()),
('history_change_reason', models.CharField(max_length=100, null=True)),

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-01-15 20:22