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
+31
View File
@@ -0,0 +1,31 @@
from django.db import models
class Atoll(models.Model):
name = models.CharField(max_length=100, unique=True)
# Maldivian administrative code, e.g. "F" for Faafu.
code = models.CharField(max_length=8, blank=True)
is_active = models.BooleanField(default=True)
class Meta:
ordering = ["name"]
def __str__(self):
return self.name
class Island(models.Model):
atoll = models.ForeignKey(Atoll, on_delete=models.PROTECT, related_name="islands")
name = models.CharField(max_length=100)
is_active = models.BooleanField(default=True)
class Meta:
ordering = ["name"]
constraints = [
models.UniqueConstraint(
fields=["atoll", "name"], name="unique_island_name_per_atoll"
)
]
def __str__(self):
return f"{self.name}, {self.atoll.name}"