1
0
Fork 0
mirror of https://github.com/Findus23/RPGnotes.git synced 2024-09-19 15:43:45 +02:00
RPGnotes/campaigns/models.py
2021-09-07 18:52:49 +02:00

23 lines
618 B
Python

from django.db import models
# Create your models here.
from django_tenants.models import DomainMixin
from tenant_users.tenants.models import TenantBase
from rpg_notes.secrets import DEBUG
class Campaign(TenantBase):
name = models.CharField(max_length=1000, unique=True)
auto_create_schema = True
def __str__(self):
return self.name
def get_absolute_url(self):
print(self.get_primary_domain().domain)
protocol = "http://" if DEBUG else "https://"
return protocol + self.get_primary_domain().domain + (":8000" if DEBUG else "")
class Domain(DomainMixin):
pass