Beispiel #1
0
class tradius_accounting(SQLModel):
    id = SQLModel.Uuid(default=uuid4, internal=True)
    acctsessionid = SQLModel.String(max_length=64, null=False, default='')
    acctuniqueid = SQLModel.String(max_length=32, null=False, default='')
    username = SQLModel.String(max_length=64, null=False, default='')
    realm = SQLModel.String(max_length=64, null=True, default='')
    nasipaddress = SQLModel.String(max_length=15, null=False, default='')
    nasportid = SQLModel.String(max_length=15, null=True, default=None)
    nasporttype = SQLModel.String(max_length=32, null=True, default=None)
    acctstarttime = SQLModel.DateTime()
    acctupdatetime = SQLModel.DateTime()
    acctstoptime = SQLModel.DateTime()
    acctinterval = SQLModel.Integer(null=True, default=None)
    acctsessiontime = SQLModel.Integer(signed=False, null=True, default=None)
    acctauthentic = SQLModel.String(null=True, default=None, max_length=32)
    connectinfo_start = SQLModel.String(max_length=50, null=True, default=None)
    connectinfo_stop = SQLModel.String(max_length=50, null=True, default=None)
    acctinputoctets = SQLModel.BigInt(null=True, default=None)
    acctoutputoctets = SQLModel.BigInt(null=True, default=None)
    calledstationid = SQLModel.String(max_length=50, null=False, default='')
    callingstationid = SQLModel.String(max_length=50, null=False, default='')
    acctterminatecause = SQLModel.String(max_length=32, null=False, default='')
    servicetype = SQLModel.String(max_length=32, default=None, null=True)
    framedprotocol = SQLModel.String(max_length=32, default=None, null=True)
    framedipaddress = SQLModel.String(max_length=15, default='', null=False)
    primary_key = id
    acctuniqueid_index = SQLModel.UniqueIndex(acctuniqueid)
    username_index = SQLModel.Index(username, nasipaddress)
    framedipaddress_index = SQLModel.Index(framedipaddress, nasipaddress)
    acctsessionid_index = SQLModel.Index(acctsessionid)
    acctsessiontime_index = SQLModel.Index(acctsessiontime)
    acctstarttime_index = SQLModel.Index(acctstarttime)
    acctinterval_index = SQLModel.Index(acctinterval)
    acctstoptime_index = SQLModel.Index(acctstoptime)
    nasipaddress_index = SQLModel.Index(nasipaddress)
Beispiel #2
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)
Beispiel #3
0
class tradius_user_group(SQLModel):
    id = SQLModel.Uuid(default=uuid4, internal=True)
    group_id = SQLModel.Uuid()
    domain = SQLModel.Fqdn(internal=True)
    tenant_id = SQLModel.String()
    user_id = SQLModel.Uuid()
    priority = SQLModel.Integer()
    creation_time = SQLModel.DateTime(readonly=True, default=now)
    unique_user_group = SQLModel.UniqueIndex(group_id, user_id)
    user_group_id_ref = SQLModel.ForeignKey(group_id, tradius_group.id)
    group_index = SQLModel.Index(group_id)
    domain_group_index = SQLModel.Index(domain, group_id)
    tenant_group_index = SQLModel.Index(tenant_id, group_id)
    tenant_domain_group_index = SQLModel.Index(domain, tenant_id, group_id)
    primary_key = id
Beispiel #4
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')
    user_class = SQLModel.Word(max_length=32, null=True)
    logins = SQLModel.Integer(null=False,
                              default=0,
                              label='Simultaneous Sessions')
    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