implemented the deletion of unnecesarry details in not chosen objects, for the sake of memory efficiency in the history
This commit is contained in:
@@ -158,3 +158,6 @@ class Collection:
|
||||
@property
|
||||
def empty(self) -> bool:
|
||||
return len(self._data) == 0
|
||||
|
||||
def clear(self):
|
||||
self.__init__(element_type=self.element_type)
|
||||
|
@@ -95,6 +95,10 @@ class DatabaseObject:
|
||||
if override or getattr(self, simple_attribute) == default_value:
|
||||
setattr(self, simple_attribute, getattr(other, simple_attribute))
|
||||
|
||||
def strip_details(self):
|
||||
for collection in type(self).DOWNWARDS_COLLECTION_ATTRIBUTES:
|
||||
getattr(self, collection).clear()
|
||||
|
||||
@property
|
||||
def metadata(self) -> Metadata:
|
||||
return Metadata()
|
||||
|
Reference in New Issue
Block a user