Пример #1
0
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
class calabiyau_duplicate(SQLModel):
    id = SQLModel.Uuid(default=uuid4, internal=True)
    package_id = SQLModel.Uuid()
    name = SQLModel.Word(max_length=64, null=False, regex=r'^[a-z0-9\._-]+$')
    server = SQLModel.Ip4(null=False)
    class_attr = SQLModel.TinyInt(null=False, default=0)
    creation_time = SQLModel.DateTime(readonly=True, default=now)
    pkg_dup_ref = SQLModel.ForeignKey(package_id, calabiyau_package.id)
    primary_key = id
Пример #3
0
class calabiyau_package_attr(SQLModel):
    id = SQLModel.Uuid(default=uuid4, internal=True)
    package_id = SQLModel.Uuid()
    attribute = SQLModel.String()
    tag = SQLModel.TinyInt(null=True, signed=False)
    value = SQLModel.String()
    ctx = SQLModel.String()
    nas_type = SQLModel.Word(max_length=64, null=False,
                             regex=r'^[a-z0-9\._-]+$')
    creation_time = SQLModel.DateTime(readonly=True, default=now)
    pkg_attr_ref = SQLModel.ForeignKey(package_id, calabiyau_package.id)
    primary_key = id
Пример #4
0
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