17 lines
486 B
Python
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."
|
|
)
|
|
)
|