deploy login & reCaptcha

This commit is contained in:
2025-05-04 15:24:28 +03:30
parent 3ab3fa2d13
commit 70fa849840
36 changed files with 494 additions and 5 deletions

View File

@@ -9,6 +9,19 @@ class User(AbstractUser, BaseModel):
mobile = models.CharField(max_length=18)
national_code = models.CharField(max_length=16)
photo = models.CharField(max_length=50)
province = models.ForeignKey(
'Province',
on_delete=models.CASCADE,
related_name='user_province',
null=True
)
city = models.ForeignKey(
'City',
on_delete=models.CASCADE,
related_name='user_city',
null=True
)
otp_status = models.BooleanField(default=False)
def __str__(self):
return f'{self.username} {self.last_name}-{self.last_login}'
@@ -27,6 +40,16 @@ class Province(BaseModel):
super(Province, self).save(*args, **kwargs)
class City(BaseModel):
name = models.CharField(max_length=50)
def __str__(self):
return f'{self.name}'
def save(self, *args, **kwargs):
super(City, self).save(*args, **kwargs)
class Organization(BaseModel):
name = models.CharField(max_length=50)
type = models.CharField(max_length=50)
@@ -36,6 +59,12 @@ class Organization(BaseModel):
related_name="province_organization",
null=True
)
city = models.ForeignKey(
'City',
on_delete=models.CASCADE,
related_name='city_organization',
null=True
)
parent_organization = models.ForeignKey(
'Organization',
on_delete=models.CASCADE,