plynx.db.db_object
¶
The class defines DBObject. This is an abstraction of all of the objects in database.
Module Contents¶
-
plynx.db.db_object.
get_class
(name: str) → DBObjectType[source]¶ Get DB Object inherited class object by its name from the registry
-
class
plynx.db.db_object.
_DBObject
[source]¶ DB Object. Abstraction of an object in the DB.
-
classmethod
load
(cls: Type[DBObjectType], _id: ObjectId, collection: Optional[str] = None)[source]¶ Load object from db.
- Args:
- _id (ObjectId): ID of the object in DB
-
save
(self, force: bool = False, collection: Optional[str] = None)[source]¶ Save Object in the database
-
classmethod
-
class
plynx.db.db_object.
DBObject
[source]¶ Bases:
plynx.db.db_object._DBObject
DB Object. Abstraction of an object in the DB.
- Args:
- obj_dict (dict, None): Representation of the object. If None, an object with default fields will be created.