Last active
April 7, 2022 06:46
-
-
Save rootisenabled/122c22f7e55636acb1cbf8c12a73ef4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cloud.inventory.models import BatteryModel, PanelModel, SmartMeterModel, EvChargerModel, InverterModel | |
from cloud.location.enums import Country | |
sm = SmartMeterModel.objects.filter(enabled_in_markets__contains=['de']) | |
bm = BatteryModel.objects.filter(enabled_in_markets__contains=['de']) | |
pm = PanelModel.objects.filter(enabled_in_markets__contains=['de']) | |
evm = EvChargerModel.objects.filter(enabled_in_markets__contains=['de']) | |
im = InverterModel.objects.filter(enabled_in_markets__contains=['de']) | |
for s in sm: | |
s.enabled_in_markets.append(Country.UK) | |
for s in sm: | |
s.save() | |
for s in bm: | |
s.enabled_in_markets.append(Country.UK) | |
for s in bm: | |
s.save() | |
for s in pm: | |
s.enabled_in_markets.append(Country.UK) | |
for s in pm: | |
s.save() | |
for s in evm: | |
s.enabled_in_markets.append(Country.UK) | |
for s in evm: | |
s.save() | |
for s in im: | |
s.enabled_in_markets.append(Country.UK) | |
for s in im: | |
s.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment