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
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