I have a DataView value that i want to see in a SummaryItem.
It’s is still a dummy function, but i should calculate how many errors occurred and show it to the user in the Summary on the Entity viewer:
Now the goal is for the user to open the items with errors and resolve the errors, but when i change the function to set the amount of errors to 3, the dataview in the entity does change, but on the Entity Manager does not:
So how can I fix this, so the EntityManager will fetch the current situation upon loading?
@DataView("Error count", duration_guess=1)
def get_warning_count(self, params, **kwargs) -> DataResult:
# Calculate amount of warnings:
#warning_count = randrange(0, 10)
warning_count = 3
group = DataGroup(warning_count=DataItem('Warning count', warning_count, suffix='x'))
result = DataResult(group)
# print(result.__dict__)
return result
and the SummaryItem:
summary = Summary(
km=SummaryItem('Km', float, 'parametrization', 'structure.general.hidden_km'),
bbk=SummaryItem('BBK', float, 'parametrization', 'structure.general.hidden_bbk'),
errors=SummaryItem('Fouten', float, 'get_warning_count', 'warning_count', suffix="x")
)