Skip to content

Instantly share code, notes, and snippets.

@rootisenabled
Last active April 7, 2022 06:46
Show Gist options
  • Save rootisenabled/122c22f7e55636acb1cbf8c12a73ef4d to your computer and use it in GitHub Desktop.
Save rootisenabled/122c22f7e55636acb1cbf8c12a73ef4d to your computer and use it in GitHub Desktop.
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