You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.5 KiB
48 lines
1.5 KiB
10 years ago
|
from sqlalchemy import Column, DateTime, String, Integer, Boolean, func
|
||
|
from ee.core.database import Base
|
||
|
|
||
|
|
||
|
class SiteDB(Base):
|
||
10 years ago
|
"""
|
||
|
Databse model for site table
|
||
|
"""
|
||
10 years ago
|
__tablename__ = 'sites'
|
||
10 years ago
|
__table_args__ = {'extend_existing': True}
|
||
10 years ago
|
id = Column(Integer, primary_key=True)
|
||
|
sitename = Column(String, unique=True)
|
||
|
|
||
|
site_type = Column(String)
|
||
|
cache_type = Column(String)
|
||
|
site_path = Column(String)
|
||
|
|
||
|
# Use default=func.now() to set the default created time
|
||
|
# of a site to be the current time when a
|
||
|
# Site record was created
|
||
|
|
||
|
created_on = Column(DateTime, default=func.now())
|
||
|
is_enabled = Column(Boolean, unique=False, default=True, nullable=False)
|
||
|
is_ssl = Column(Boolean, unique=False, default=False)
|
||
|
storage_fs = Column(String)
|
||
|
storage_db = Column(String)
|
||
10 years ago
|
db_name = Column(String)
|
||
|
db_password = Column(String)
|
||
|
db_user = Column(String)
|
||
10 years ago
|
|
||
10 years ago
|
# def __init__(self, sitename=None, site_type=None, cache_type=None,
|
||
|
# site_path=None, site_enabled=None,
|
||
|
# is_ssl=None, storage_fs=None, storage_db=None):
|
||
|
# self.sitename = sitename
|
||
|
# self.site_type = site_type
|
||
|
# self.cache_type = cache_type
|
||
|
# self.site_path = site_path
|
||
|
# self.is_enabled = site_enabled
|
||
|
# self.is_ssl = is_ssl
|
||
|
# self.storage_fs = storage_fs
|
||
|
# self.storage_db = storage_db
|
||
10 years ago
|
|
||
|
# def __repr__(self):
|
||
|
# return '<Site %r>' % (self.site_type)
|
||
|
#
|
||
|
# def getType(self):
|
||
|
# return '%r>' % (self.site_type)
|