コード例 #1
0
ファイル: packages.py プロジェクト: Vuader/calabiyau
class calabiyau_package(SQLModel):
    id = SQLModel.Uuid(default=uuid4, internal=True)
    virtual_id = SQLModel.Uuid()
    domain = SQLModel.Fqdn(internal=True)
    name = SQLModel.String(max_length=64)
    plan = SQLModel.String(max_length=20)
    volume_gb = SQLModel.SmallInt(null=True, default=0)
    volume_metric = SQLModel.Enum('days', 'weeks', 'months')
    volume_span = SQLModel.TinyInt(null=True, default=0)
    volume_repeat = SQLModel.Boolean(default=True)
    package_metric = SQLModel.Enum('days', 'weeks', 'months')
    package_span = SQLModel.TinyInt(null=True, default=0)
    pool_id = SQLModel.String(null=True, max_length=64)
    static4 = SQLModel.Boolean(default=False)
    static6 = SQLModel.Boolean(default=False)
    simultaneous = SQLModel.Boolean(default=True)
    deactivate_login = SQLModel.String(max_length=20)
    deactivate_coa = SQLModel.String(max_length=20)
    activate_coa = SQLModel.String(max_length=20)
    fup_login = SQLModel.String(max_length=20)
    fup_coa = SQLModel.String(max_length=20)
    creation_time = SQLModel.DateTime(default=now, readonly=True)
    pkg_virtual_ref = SQLModel.ForeignKey(virtual_id,
                                          calabiyau_virtual.id,
                                          on_delete='RESTRICT')
    pkg_pool_ref = SQLModel.ForeignKey(pool_id,
                                       calabiyau_pool.id,
                                       on_delete='RESTRICT')
    primary_key = id
コード例 #2
0
ファイル: subscribers.py プロジェクト: Vuader/calabiyau
class calabiyau_subscriber(SQLModel):
    id = SQLModel.Uuid(default=uuid4, internal=True)
    package_id = SQLModel.Uuid()
    domain = SQLModel.Fqdn(internal=True)
    tenant_id = SQLModel.Uuid(internal=True)
    username = SQLModel.Username(max_length=64, null=False)
    password = SQLModel.Password(max_length=150, null=True)
    email = SQLModel.Email(max_length=100)
    name = SQLModel.String(max_length=64)
    phone_mobile = SQLModel.Phone()
    phone_office = SQLModel.Phone()
    designation = SQLModel.Enum('', 'Mr', 'Mrs', 'Ms', 'Dr', 'Prof')
    static_ip4 = SQLModel.String(null=True, max_length=64)
    ctx = SQLModel.SmallInt(null=False, default=0)
    notified = SQLModel.Boolean(null=False, default=True)
    enabled = SQLModel.Boolean(default=True)
    creation_time = SQLModel.DateTime(null=False, default=now, readonly=True)
    volume_expire = SQLModel.DateTime(null=True)
    package_expire = SQLModel.DateTime(null=True)
    volume_used_bytes = SQLModel.BigInt(null=False, signed=False, default=0)
    volume_used = SQLModel.Boolean(null=False, default=False)
    calabiyau_unique = SQLModel.UniqueIndex(username, domain)
    calabiyau_pkg_ref = SQLModel.ForeignKey(package_id,
                                            calabiyau_package.id,
                                            on_delete='RESTRICT')
    primary_key = id
コード例 #3
0
ファイル: domains.py プロジェクト: Vuader/infinitystone
class luxon_domain(SQLModel):
    id = SQLModel.Uuid(default=uuid4, internal=True)
    name = SQLModel.Fqdn(null=False)
    description = SQLModel.Text()
    enabled = SQLModel.Boolean(default=True)
    creation_time = SQLModel.DateTime(default=now, readonly=True)
    primary_key = id
    unique_domain = SQLModel.UniqueIndex(name)
    db_default_rows = DOMAINS
    domains = SQLModel.Index(name)
コード例 #4
0
ファイル: topups.py プロジェクト: Vuader/calabiyau
class calabiyau_topup(SQLModel):
    id = SQLModel.Uuid(default=uuid4, internal=True)
    user_id = SQLModel.Uuid()
    volume_gb = SQLModel.SmallInt(null=False, default=1)
    volume_metric = SQLModel.Enum('days', 'weeks', 'months')
    volume_span = SQLModel.TinyInt(null=False, default=1)
    volume_expire = SQLModel.DateTime(default=now, readonly=True)
    volume_repeat = SQLModel.Boolean(default=False)
    creation_time = SQLModel.DateTime(readonly=True, default=now)
    topup_user_index = SQLModel.Index(user_id)
    topup_user_ref = SQLModel.ForeignKey(user_id, calabiyau_subscriber.id)
    primary_key = id
コード例 #5
0
class Model_Test2(SQLModel):
    id = SQLModel.Integer(length=11, null=True)
    primary_key = id
    stringcol = SQLModel.String(length=128)
    floatcol = SQLModel.Float(4,4)
    doublecol = SQLModel.Double(4,4)
    decimalcol = SQLModel.Decimal(4,4)
    datetimecol = SQLModel.DateTime(4,4)
    pyobject = SQLModel.PyObject()
    blob = SQLModel.Blob()
    text = SQLModel.Text()
    enum = SQLModel.Enum('option1', 'option2')
    boolean = SQLModel.Boolean()
    unique_index2 = SQLModel.UniqueIndex(stringcol)
コード例 #6
0
class luxon_tenant(SQLModel):
    id = SQLModel.Uuid(default=uuid4, internal=True)
    domain = SQLModel.Fqdn(internal=True)
    tenant_id = SQLModel.Uuid(internal=True)
    name = SQLModel.String(max_length=100, null=False)
    enabled = SQLModel.Boolean(default=True)
    creation_time = SQLModel.DateTime(default=now, readonly=True)
    unique_tenant = SQLModel.UniqueIndex(domain, name)
    tenants = SQLModel.Index(id, domain)
    tenants_search_name = SQLModel.Index(domain, name)
    tenants_per_domain = SQLModel.Index(domain)
    primary_key = id
    tenant_domain_ref = SQLModel.ForeignKey(domain, luxon_domain.name)
    tenant_parent_ref = SQLModel.ForeignKey(tenant_id, id)
コード例 #7
0
class tradius_user(SQLModel):
    id = SQLModel.Uuid(default=uuid4, internal=True)
    virtual_id = SQLModel.Uuid()
    domain = SQLModel.Fqdn(internal=True)
    tenant_id = SQLModel.Uuid(internal=True)
    username = SQLModel.Username(max_length=64, null=False)
    password = SQLModel.Password(max_length=150, null=True)
    email = SQLModel.Email(max_length=100)
    name = SQLModel.String(max_length=64)
    phone_mobile = SQLModel.Phone()
    phone_office = SQLModel.Phone()
    designation = SQLModel.Enum('', 'Mr', 'Mrs', 'Ms', 'Dr', 'Prof')
    dpi = SQLModel.String(max_length=20)
    enabled = SQLModel.Boolean(default=True)
    creation_time = SQLModel.DateTime(default=now, readonly=True)
    unique_username = SQLModel.UniqueIndex(username, domain)
    user_virtual_ref = SQLModel.ForeignKey(virtual_id,
                                           tradius_virtual.id,
                                           on_delete='RESTRICT')
    primary_key = id
コード例 #8
0
class luxon_user(SQLModel):
    id = SQLModel.Uuid(default=uuid4, internal=True)
    tag = SQLModel.String(hidden=True, max_length=30, null=False)
    domain = SQLModel.Fqdn(internal=True)
    tenant_id = SQLModel.Uuid(internal=True)
    username = SQLModel.Username(max_length=100, null=False)
    password = SQLModel.String(max_length=100, null=True)
    email = SQLModel.Email(max_length=255)
    name = SQLModel.String(max_length=100)
    phone_mobile = SQLModel.Phone()
    phone_office = SQLModel.Phone()
    designation = SQLModel.Enum('', 'Mr', 'Mrs', 'Ms', 'Dr', 'Prof')
    last_login = SQLModel.DateTime(readonly=True)
    enabled = SQLModel.Boolean(default=True)
    creation_time = SQLModel.DateTime(default=now, readonly=True)
    unique_username = SQLModel.UniqueIndex(domain, username)
    user_tenant_ref = SQLModel.ForeignKey(tenant_id, luxon_tenant.id)
    user_domain_ref = SQLModel.ForeignKey(domain, luxon_domain.name)
    users = SQLModel.Index(domain, username)
    users_tenants = SQLModel.Index(domain, tenant_id)
    users_domain = SQLModel.Index(domain)
    primary_key = id
    db_default_rows = USERS