Files
sarlinkportal/backend/locations/management/commands/seed_locations.py
T
2026-09-22 00:50:30 +05:00

17 lines
486 B
Python

from django.core.management.base import BaseCommand
from locations.models import Atoll, Island
from locations.seed import seed
class Command(BaseCommand):
help = "Create the atolls and islands SAR Link serves (idempotent)."
def handle(self, *args, **options):
atolls, islands = seed(Atoll, Island)
self.stdout.write(
self.style.SUCCESS(
f"Locations seeded: {atolls} atoll(s), {islands} island(s) created."
)
)