mirror of
https://github.com/retspen/webvirtcloud
synced 2024-11-01 12:04:15 +00:00
28 lines
903 B
Python
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),
|
|
]
|