register and sign in pages

This commit is contained in:
2026-09-22 00:50:30 +05:00
parent f313867653
commit 78d04f75d1
96 changed files with 6383 additions and 109 deletions
@@ -0,0 +1,32 @@
from django.db import migrations
from locations.seed import seed
def seed_locations(apps, schema_editor):
seed(apps.get_model("locations", "Atoll"), apps.get_model("locations", "Island"))
def unseed_locations(apps, schema_editor):
"""Only removes rows nothing references."""
Atoll = apps.get_model("locations", "Atoll")
Island = apps.get_model("locations", "Island")
from locations.seed import ATOLLS
for entry in ATOLLS:
Island.objects.filter(
atoll__name=entry["name"], name__in=entry["islands"], users__isnull=True
).delete()
Atoll.objects.filter(
name=entry["name"], islands__isnull=True, users__isnull=True
).delete()
class Migration(migrations.Migration):
dependencies = [
("locations", "0001_initial"),
# Islands/atolls are referenced by users; keep the tables in step.
("users", "0001_initial"),
]
operations = [migrations.RunPython(seed_locations, unseed_locations)]