ölkjvy
This commit is contained in:
parent
160c5bbd66
commit
ebe3d9328c
@ -60,7 +60,7 @@ class Collection:
|
||||
if unified in self._by_attribute[name]:
|
||||
return self._by_attribute[name][unified]
|
||||
|
||||
def append(self, element: SourceAttribute):
|
||||
def append(self, element: SourceAttribute, merge_on_conflict: bool = True):
|
||||
if type(element) is not self.element_type and self.element_type is not None:
|
||||
raise TypeError(f"{type(element)} is not the set type {self.element_type}")
|
||||
|
||||
|
@ -7,6 +7,9 @@ from ..utils.shared import (
|
||||
|
||||
|
||||
class DatabaseObject:
|
||||
COLLECTION_ATTRIBUTES: tuple = tuple()
|
||||
SIMPLE_ATTRIBUTES: tuple = tuple()
|
||||
|
||||
def __init__(self, _id: str = None, dynamic: bool = False, **kwargs) -> None:
|
||||
if _id is None and not dynamic:
|
||||
"""
|
||||
@ -20,6 +23,9 @@ class DatabaseObject:
|
||||
self.id: Optional[str] = _id
|
||||
|
||||
self.dynamic = dynamic
|
||||
|
||||
def merge(self, other, override: bool = False):
|
||||
for collection in
|
||||
|
||||
|
||||
class MainObject(DatabaseObject):
|
||||
@ -33,6 +39,7 @@ class MainObject(DatabaseObject):
|
||||
It has all the functionality of the "DatabaseObject" (it inherits from said class)
|
||||
but also some added functions as well.
|
||||
"""
|
||||
|
||||
def __init__(self, _id: str = None, dynamic: bool = False, **kwargs):
|
||||
super().__init__(_id=_id, dynamic=dynamic, **kwargs)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user