@@ -0,0 +1,1652 @@
+from typing import Dict%0Afrom typing import Type%0Afrom typing import Union%0Afrom typing import List%0Afrom ..database import BaseModel, db%0A%0A%0Aclass DatabaseManager:%0A    def register(self, **kwargs) -%3E BaseModel:%0A        %22%22%22Register e  new object into the database.%0A        Args:%0A            parameters : List of object parameters.%0A        Returns:%0A            object: Database Object%0A        %22%22%22%0A        _obj = self._schema(**kwargs)%0A        self.db.session.add(_obj)%0A        self.db.session.commit()%0A        return _obj%0A%0A    def query(self, **kwargs) -%3E Union%5BNone, BaseModel%5D:%0A        %22%22%22Query db objects filtering by parameters%0A        Args:%0A            parameters : List of parameters used to filter.%0A        %22%22%22%0A        objects = self.db.session.query(self._schema).filter_by(**kwargs).all()%0A        return objects%0A%0A    def all(self) -%3E List%5BBaseModel%5D:%0A        return list(self.db.session.query(self._schema).all())%0A%0A    def delete(self, **kwargs):%0A        %22%22%22Delete an object from the database.%0A        Args:%0A            parameters: Parameters used to filter the object.%0A        %22%22%22%0A        object_to_delete = self.query(**kwargs)%0A        self.db.session.delete(object_to_delete)%0A        self.db.session.commit()%0A%0A    def modify(self, query, values):%0A        %22%22%22Modifies one or many records.%22%22%22%0A        self.db.session.query(self._schema).filter_by(**query).update(values)%0A        self.db.session.commit()%0A%0A    def contain(self, **kwargs) -%3E bool:%0A        objects = self.db.session.query(self._schema).filter_by(**kwargs).all()%0A        return len(objects) != 0%0A%0A    def __len__(self) -%3E int:%0A        return self.db.session.query(self._schema).count()%0A

ADD Abstract Database Manager class