add Dataclass for norm documents

This commit is contained in:
2023-05-23 16:24:19 +02:00
parent 2bf4d1b6ea
commit 9361e1ce95
2 changed files with 37 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ from .enumeration import *
from .infrastructure import * from .infrastructure import *
from .material import * from .material import *
from .metrics import * from .metrics import *
from .norm_documents import *
from .norm_specification import * from .norm_specification import *
from .project import * from .project import *
from .sheartest import * from .sheartest import *

View File

@@ -0,0 +1,36 @@
from mongoengine import *
from enum import Enum
class NormKindEnum(Enum):
Aggregate = 'Aggregate'
Bitumen = 'Bitumen'
Asphalt = 'Asphalt'
class NormPublisherEnum(Enum):
FGSV = 'FGSV'
class NormDocument(Document):
kind = EnumField(NormKindEnum, required=True)
name = StringField(required=True)
publisher = EnumField(NormPublisherEnum, required=True, default=NormPublisherEnum.FGSV)
name = StringField(required=True)
nam_short = StringField(required=True)
number = StringField(required=True)
year =IntField(min_value=1900, max_value=2099)
month = IntField(min_value=1, max_value=12)
meta = {
'allow_inheritance': True,
'index_opts': {},
'index_background': True,
'index_cls': False,
'auto_create_index': True,
'collection': 'norm_documents',
"db_alias": 'dblabtests',
}