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

    dependencies = [
        ("sites", "0002_alter_domain_unique"),
        ("devices", "0006_auto_20200913_0038"),
    ]

    operations = [
        migrations.AddField(
            model_name="device",
            name="sites",
            field=models.ManyToManyField(blank=True, to="sites.Site"),
        ),
        migrations.RunPython(lambda apps, schema_editor: model2default_site(
            apps, schema_editor, "devices", "Device")),
    ]
Example #2
0
class Migration(migrations.Migration):

    dependencies = [
        ("sites", "0002_alter_domain_unique"),
        ("fin_app", "0001_initial"),
    ]

    operations = [
        migrations.AddField(
            model_name="payalltimegateway",
            name="sites",
            field=models.ManyToManyField(blank=True, to="sites.Site"),
        ),
        migrations.RunPython(lambda apps, schema_editor: model2default_site(
            apps, schema_editor, "fin_app", "PayAllTimeGateway")),
    ]
Example #3
0
class Migration(migrations.Migration):

    dependencies = [
        ("sites", "0002_alter_domain_unique"),
        ("profiles", "0002_auto_20200723_1633"),
    ]

    operations = [
        migrations.AddField(
            model_name="baseaccount",
            name="sites",
            field=models.ManyToManyField(blank=True, to="sites.Site"),
        ),
        migrations.RunPython(lambda apps, schema_editor: model2default_site(
            apps, schema_editor, "profiles", "BaseAccount")),
    ]
Example #4
0
class Migration(migrations.Migration):
    dependencies = [
        ("sites", "0002_alter_domain_unique"),
        ("gateways", "0002_fetch_credentials"),
    ]

    operations = [
        migrations.AddField(
            model_name="gateway",
            name="sites",
            field=models.ManyToManyField(blank=True, to="sites.Site"),
        ),
        migrations.AlterField(
            model_name="gateway",
            name="gw_type",
            field=models.PositiveSmallIntegerField(
                choices=[(0, "Mikrotik gateway"), (1, "Linux gateway")], default=0, verbose_name="Type"
            ),
        ),
        migrations.RunPython(
            lambda apps, schema_editor: model2default_site(apps, schema_editor, "gateways", "Gateway")
        ),
    ]
Example #5
0
class Migration(migrations.Migration):
    dependencies = [
        ("sites", "0002_alter_domain_unique"),
        ("services", "0003_service_speed_burst"),
    ]

    operations = [
        migrations.AddField(
            model_name="oneshotpay",
            name="sites",
            field=models.ManyToManyField(blank=True, to="sites.Site"),
        ),
        migrations.AddField(
            model_name="periodicpay",
            name="sites",
            field=models.ManyToManyField(blank=True, to="sites.Site"),
        ),
        migrations.AddField(
            model_name="service",
            name="sites",
            field=models.ManyToManyField(blank=True, to="sites.Site"),
        ),
        migrations.AlterField(
            model_name="oneshotpay",
            name="pay_type",
            field=models.PositiveSmallIntegerField(
                choices=[(0, oneshot.ShotDefault)],
                default=0,
                help_text="Uses for callbacks before pay and after pay",
                verbose_name="One shot pay type",
            ),
        ),
        migrations.AlterField(
            model_name="periodicpay",
            name="calc_type",
            field=models.PositiveSmallIntegerField(
                choices=[(0, periodic.PeriodicPayCalcDefault),
                         (1, periodic.PeriodicPayCalcRandom)],
                default=0,
                verbose_name="Script type for calculations",
            ),
        ),
        migrations.AlterField(
            model_name="service",
            name="calc_type",
            field=models.PositiveSmallIntegerField(
                choices=[
                    (0, services.ServiceDefault),
                    (1, services.TariffDp),
                    (2, services.TariffCp),
                    (3, services.TariffDaily),
                ],
                verbose_name="Script",
            ),
        ),
        migrations.AlterField(
            model_name="service",
            name="cost",
            field=models.FloatField(
                validators=[MinValueValidator(limit_value=0.0)],
                verbose_name="Cost"),
        ),
        migrations.AlterField(
            model_name="service",
            name="speed_burst",
            field=models.FloatField(
                default=1.0,
                help_text=
                "Result burst = speed * speed_burst, speed_burst must be >= 1.0",
                validators=[MinValueValidator(limit_value=1.0)],
                verbose_name="Speed burst",
            ),
        ),
        migrations.RunPython(lambda apps, schema_editor: model2default_site(
            apps, schema_editor, "services", "Service")),
        migrations.RunPython(lambda apps, schema_editor: model2default_site(
            apps, schema_editor, "services", "PeriodicPay")),
        migrations.RunPython(lambda apps, schema_editor: model2default_site(
            apps, schema_editor, "services", "OneShotPay")),
    ]