DomainBase is abstract
This commit is contained in:
parent
76e2111ebc
commit
a28d6ac963
|
@ -2,26 +2,6 @@ from django.db import models
|
||||||
from base import BaseModel
|
from base import BaseModel
|
||||||
from settings import SERVER_CHOICES, EMAIL_CHOICES, DB_CHOICES, PROJECT_TYPES
|
from settings import SERVER_CHOICES, EMAIL_CHOICES, DB_CHOICES, PROJECT_TYPES
|
||||||
|
|
||||||
SERVER_CHOICES = (
|
|
||||||
('camp', 'camp.r-w-x.org'),
|
|
||||||
('marlon', 'marlon.in'),
|
|
||||||
)
|
|
||||||
|
|
||||||
EMAIL_CHOICES = (
|
|
||||||
('gmail', 'Gmail'),
|
|
||||||
('mailb', 'MailB'),
|
|
||||||
)
|
|
||||||
|
|
||||||
DB_CHOICES = (
|
|
||||||
('mysql', 'MySQL'),
|
|
||||||
('postgres', 'PostgreSQL'),
|
|
||||||
('sqlite', 'SQLite'),
|
|
||||||
)
|
|
||||||
|
|
||||||
PROJECT_TYPES = (
|
|
||||||
('django', 'Django'),
|
|
||||||
('www', 'PHP or Static'),
|
|
||||||
)
|
|
||||||
|
|
||||||
class DomainBase(BaseModel):
|
class DomainBase(BaseModel):
|
||||||
url = models.CharField(max_length=512)
|
url = models.CharField(max_length=512)
|
||||||
|
@ -32,6 +12,9 @@ class DomainBase(BaseModel):
|
||||||
db_type = models.CharField(choices=DB_CHOICES, blank=True)
|
db_type = models.CharField(choices=DB_CHOICES, blank=True)
|
||||||
db_name = models.CharField(max_length=255, blank=True)
|
db_name = models.CharField(max_length=255, blank=True)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
abstract = True
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.url
|
return self.url
|
||||||
|
|
||||||
|
@ -40,5 +23,5 @@ class Domain(DomainBase):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class SubDomain(DomainBase):
|
class Subdomain(DomainBase):
|
||||||
main_domain = models.ForeignKey(Domain)
|
main_domain = models.ForeignKey(Domain)
|
Loading…
Reference in New Issue
Block a user