INF-417 InfrastructureInventoryObject implemented
[pti/o2.git] / o2common / domain / base.py
index 128f950..698843c 100644 (file)
@@ -20,6 +20,20 @@ from sqlalchemy.exc import NoInspectionAvailable
 from .events import Event
 
 
+class InfrastructureInventoryObject:
+    ObjectState = {}
+
+    def __init__(self) -> None:
+        # self.ObjectState = {}
+        pass
+
+    def get_fields_as_dict(self, fields):
+        for field in fields:
+            if hasattr(self, field):
+                self.ObjectState[field] = getattr(self, field)
+        return self.ObjectState
+
+
 class AgRoot:
 
     events = []