Last active
August 3, 2020 05:48
-
-
Save MainaKamau92/18c23162f3b15f10b15d7e0508a982dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import uuid | |
import os | |
from django.db import models | |
from tenant_schemas.models import TenantMixin | |
# Create your models here. | |
class Client(TenantMixin): | |
REQUIRED_FIELDS = ('tenant_name', 'paid_until', 'schema_name', 'on_trial') | |
tenant_name = models.CharField(max_length=100, unique=True, null=False, blank=False) | |
tenant_uuid = models.UUIDField(default=uuid.uuid4, null=False, blank=False) | |
paid_until = models.DateField() | |
on_trial = models.BooleanField() | |
created_on = models.DateField(auto_now_add=True) | |
domain_url = models.URLField(blank=True, null=True, default=os.getenv('DOMAIN')) | |
# default true, schema will be automatically created and synced when it is saved | |
auto_create_schema = True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment