remove pydantic from models.py
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass
|
||||||
from typing import ClassVar
|
from typing import ClassVar
|
||||||
|
|
||||||
from src.models import KeypadSize
|
from src.models import KeypadSize
|
||||||
|
|||||||
@@ -1,22 +1,24 @@
|
|||||||
from pydantic import BaseModel
|
from dataclasses import dataclass
|
||||||
|
|
||||||
|
@dataclass
|
||||||
class EncipheredNKode(BaseModel):
|
class EncipheredNKode:
|
||||||
code: str
|
code: str
|
||||||
mask: str
|
mask: str
|
||||||
|
|
||||||
|
|
||||||
class NKodePolicy(BaseModel):
|
@dataclass
|
||||||
|
class NKodePolicy:
|
||||||
max_nkode_len: int = 10
|
max_nkode_len: int = 10
|
||||||
min_nkode_len: int = 4
|
min_nkode_len: int = 4
|
||||||
distinct_sets: int = 0
|
distinct_sets: int = 0
|
||||||
distinct_attributes: int = 4
|
distinct_attributes: int = 4
|
||||||
byte_len: int = 2 # Todo: this should change the total number of bytes an attribute or set value can be
|
byte_len: int = 2 # Todo: this should change the total number of bytes an attribute or set value can be
|
||||||
lock_out: int = 5
|
lock_out: int = 5
|
||||||
expiration: int = -1 # in seconds -1 means never expires
|
expiration: int = -1 # in seconds -1 means nkode never expires
|
||||||
|
|
||||||
|
|
||||||
class KeypadSize(BaseModel):
|
@dataclass
|
||||||
|
class KeypadSize:
|
||||||
attrs_per_key: int
|
attrs_per_key: int
|
||||||
numb_of_keys: int
|
numb_of_keys: int
|
||||||
|
|
||||||
@@ -26,4 +28,4 @@ class KeypadSize(BaseModel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def is_dispersable(self) -> bool:
|
def is_dispersable(self) -> bool:
|
||||||
return self.attrs_per_key <= self.numb_of_keys
|
return self.attrs_per_key <= self.numb_of_keys
|
||||||
Reference in New Issue
Block a user