add Dataclass for norm documents
This commit is contained in:
@@ -4,6 +4,7 @@ from .enumeration import *
|
||||
from .infrastructure import *
|
||||
from .material import *
|
||||
from .metrics import *
|
||||
from .norm_documents import *
|
||||
from .norm_specification import *
|
||||
from .project import *
|
||||
from .sheartest import *
|
||||
|
||||
36
src/paveit/datamodels/norm_documents.py
Normal file
36
src/paveit/datamodels/norm_documents.py
Normal 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',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user