feat: add user_settings for timezone and language

This commit is contained in:
Herculino Trotta
2024-10-11 01:56:06 -03:00
parent fde0dd420a
commit 2c55109302
5 changed files with 90 additions and 0 deletions

View File

@@ -26,5 +26,18 @@ class UserSettings(models.Model):
)
hide_amounts = models.BooleanField(default=False)
language = models.CharField(
max_length=10,
choices=(("auto", _("Auto")),) + settings.LANGUAGES,
default="auto",
verbose_name=_("Language"),
)
timezone = models.CharField(
max_length=50,
choices=[("auto", _("Auto"))] + [(tz, tz) for tz in pytz.common_timezones],
default="auto",
verbose_name=_("Time Zone"),
)
def __str__(self):
return f"{self.user.email}'s settings"