add datamodel for project and workpackages; mod other modules
This commit is contained in:
parent
5ee277b20d
commit
6232f76561
@ -1,3 +1,5 @@
|
|||||||
from .citt import *
|
from .citt import *
|
||||||
from .material import *
|
from .material import *
|
||||||
|
from .project import *
|
||||||
from .sheartest import *
|
from .sheartest import *
|
||||||
|
from .workpackage import *
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import datetime
|
import datetime
|
||||||
from xml.dom.minidom import Document
|
|
||||||
|
|
||||||
from mongoengine import *
|
from mongoengine import *
|
||||||
|
|
||||||
|
@ -11,6 +11,8 @@ class Material(Document):
|
|||||||
}})
|
}})
|
||||||
|
|
||||||
tags = ListField(StringField())
|
tags = ListField(StringField())
|
||||||
|
project = StringField(required=False)
|
||||||
|
norm = StringField(required=True, default='TP Asphalt Teil 24')
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
'allow_inheritance': True,
|
'allow_inheritance': True,
|
||||||
@ -26,8 +28,10 @@ class Asphalt(Material):
|
|||||||
|
|
||||||
name = StringField()
|
name = StringField()
|
||||||
material = StringField()
|
material = StringField()
|
||||||
|
bitumen = StringField(required=False)
|
||||||
|
|
||||||
young_modulus = DictField()
|
young_modulus = DictField()
|
||||||
|
fatigue = DictField()
|
||||||
|
|
||||||
|
|
||||||
class Bitumen(Material):
|
class Bitumen(Material):
|
||||||
|
27
src/pytestpavement/models/project.py
Normal file
27
src/pytestpavement/models/project.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import datetime
|
||||||
|
|
||||||
|
from mongoengine import *
|
||||||
|
|
||||||
|
|
||||||
|
class Project(Document):
|
||||||
|
|
||||||
|
name = StringField(required=True)
|
||||||
|
name_short = StringField(required=False)
|
||||||
|
project_id = StringField(required=True)
|
||||||
|
|
||||||
|
date = DateTimeField(default=datetime.datetime.now,
|
||||||
|
wtf_options={"render_kw": {
|
||||||
|
"step": "60"
|
||||||
|
}})
|
||||||
|
|
||||||
|
tags = ListField(StringField())
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
'allow_inheritance': True,
|
||||||
|
'index_opts': {},
|
||||||
|
'index_background': True,
|
||||||
|
'index_cls': False,
|
||||||
|
'auto_create_index': True,
|
||||||
|
'collection': 'projects'
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,8 @@ from mongoengine import *
|
|||||||
|
|
||||||
from .data import DataSheartest
|
from .data import DataSheartest
|
||||||
from .material import Material
|
from .material import Material
|
||||||
|
from .project import Project
|
||||||
|
from .workpackage import Workpackage
|
||||||
|
|
||||||
|
|
||||||
class DynamicShearTest(Document):
|
class DynamicShearTest(Document):
|
||||||
@ -24,8 +26,8 @@ class DynamicShearTest(Document):
|
|||||||
filehash = StringField(required=True)
|
filehash = StringField(required=True)
|
||||||
speciment_name = StringField()
|
speciment_name = StringField()
|
||||||
|
|
||||||
project = StringField(required=True)
|
project = LazyReferenceField(Project, required=True)
|
||||||
workpackage = StringField()
|
workpackage = LazyReferenceField(Workpackage, required=True)
|
||||||
|
|
||||||
material1 = LazyReferenceField(Material, required=True)
|
material1 = LazyReferenceField(Material, required=True)
|
||||||
material2 = LazyReferenceField(Material, required=True)
|
material2 = LazyReferenceField(Material, required=True)
|
||||||
|
28
src/pytestpavement/models/workpackage.py
Normal file
28
src/pytestpavement/models/workpackage.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import datetime
|
||||||
|
|
||||||
|
from mongoengine import *
|
||||||
|
|
||||||
|
from .project import Project
|
||||||
|
|
||||||
|
|
||||||
|
class Workpackage(Document):
|
||||||
|
|
||||||
|
name = StringField(required=True)
|
||||||
|
name_short = StringField(required=False)
|
||||||
|
wp_id = StringField(required=True)
|
||||||
|
|
||||||
|
project = LazyReferenceField(Project, required=True)
|
||||||
|
|
||||||
|
date = DateTimeField(default=datetime.datetime.now,
|
||||||
|
wtf_options={"render_kw": {
|
||||||
|
"step": "60"
|
||||||
|
}})
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
'allow_inheritance': True,
|
||||||
|
'index_opts': {},
|
||||||
|
'index_background': True,
|
||||||
|
'index_cls': False,
|
||||||
|
'auto_create_index': True,
|
||||||
|
'collection': 'workpackages'
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user