further dict wrapper update

This commit is contained in:
Chuck
2025-09-15 11:43:47 -04:00
parent 28c2dcd2f7
commit 625a501da5

View File

@@ -94,6 +94,28 @@ class DictWrapper:
# Support .get() method # Support .get() method
return getattr(self, key, default) return getattr(self, key, default)
def __str__(self):
# Return empty string for missing values to avoid template errors
if hasattr(self, '_value'):
return str(self._value) if self._value is not None else ''
return ''
def __repr__(self):
# Return empty string for missing values
if hasattr(self, '_value'):
return repr(self._value) if self._value is not None else ''
return ''
def __html__(self):
# Support for MarkupSafe HTML escaping
return str(self)
def __bool__(self):
# Return False for empty wrappers
if hasattr(self, '_value'):
return bool(self._value)
return False
class DisplayMonitor: class DisplayMonitor:
def __init__(self): def __init__(self):
self.running = False self.running = False