bernardopires / django-tenant-schemas

Tenant support for Django using PostgreSQL schemas.
https://django-tenant-schemas.readthedocs.org/en/latest/
MIT License
1.46k stars 424 forks source link

Tenant wise timezone settings #621

Open amitgaru2 opened 4 years ago

amitgaru2 commented 4 years ago

Hello I didn't found any tenant wise timezone settings. If this already exists please inform.

jihoon796 commented 4 years ago

@arneec you can configure this when you are defining a client model. However you choose to do this is up to you though:

from django.db import models
from jsonfield import JSONField
from tenant_schemas.models import TenantMixin
from timezone_field import TimeZoneField

class Client(TenantMixin):
    name = models.CharField(max_length=100)
    paid_until =  models.DateField()
    on_trial = models.BooleanField()
    created_on = models.DateField(auto_now_add=True)
    # other desired attributes
    timezone = TimeZoneField(default='UTC')

See docs: https://django-tenant-schemas.readthedocs.io/en/latest/install.html#the-tenant-model