move BitumenParameter to data, add function to read all parameters
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import datetime
|
||||
from re import T
|
||||
|
||||
from bson.json_util import loads
|
||||
from mongoengine import *
|
||||
|
||||
from .enumeration import BitumenCategoryEnum, NormEnum
|
||||
from .norm_specification import DeliveryGrain, EnumerateBase
|
||||
from .project import Project
|
||||
from .usermanagement import Organisation, User
|
||||
from .norm_specification import DeliveryGrain, EnumerateBase
|
||||
from .enumeration import BitumenCategoryEnum, NormEnum
|
||||
|
||||
|
||||
|
||||
class Material(Document):
|
||||
@@ -82,6 +82,20 @@ class Bitumen(Material):
|
||||
parameter = ReferenceField(Material)
|
||||
limits = LazyReferenceField(EnumerateBase)
|
||||
|
||||
def to_dict(self):
|
||||
# convert data to dict
|
||||
data = self.to_mongo().to_dict()
|
||||
|
||||
# Laden und hinzufügen der referenzierten Daten
|
||||
if self.parameter:
|
||||
data['parameter'] = self.parameter.to_mongo().to_dict()
|
||||
|
||||
|
||||
print(data)
|
||||
|
||||
# Konvertieren Sie das BSON-Dokument in ein Python-Dict
|
||||
return data
|
||||
|
||||
|
||||
|
||||
class Bitumenemulsion(Material):
|
||||
|
||||
Reference in New Issue
Block a user