1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-26 08:05:22 +00:00
webvirtcloud/appsettings/migrations/0006_auto_20220630_0717.py
2022-09-05 15:38:00 +03:00

28 lines
903 B
Python

# Generated by Django 3.2.13 on 2022-06-30 07:17
from django.db import migrations
from django.utils.translation import gettext_lazy as _
def add_default_settings(apps, schema_editor):
setting = apps.get_model("appsettings", "AppSettings")
db_alias = schema_editor.connection.alias
setting.objects.using(db_alias).bulk_create([
setting(31, _("VM DRBD Status"), "VM_DRBD_STATUS", "False", "True,False", _("Show VM DRBD Status")),
])
def del_default_settings(apps, schema_editor):
setting = apps.get_model("appsettings", "AppSettings")
db_alias = schema_editor.connection.alias
setting.objects.using(db_alias).filter(key="VM_DRBD_STATUS").delete()
class Migration(migrations.Migration):
dependencies = [
('appsettings', '0005_auto_20200911_1233'),
]
operations = [
migrations.RunPython(add_default_settings, del_default_settings),
]