示例#1
0
    def getOverrides(self, DBReq: DBRequest) -> None:
        self.overwrite_container = DBReq.get("overwrite_container", None)
        if type(self.overwrite_container) is not bool:
            self.overwrite_container = bool(self.overwrite_container)

        self.overwrite_entrys = DBReq.get("overwrite_entrys", None)
        if type(self.overwrite_entrys) is not bool:
            self.overwrite_entrys = bool(self.overwrite_entrys)
示例#2
0
文件: delete.py 项目: The-CJ/PhaazeDB
    def getOffset(self, DBReq: DBRequest) -> None:
        self.offset = DBReq.get("offset", -1)
        if type(self.offset) is str:
            if self.offset.isdigit():
                self.offset = int(self.offset)

        if type(self.offset) is not int:
            self.offset = -1
示例#3
0
	def getContainter(self, DBReq:DBRequest) -> None:
		self.container = DBReq.get("container", "")
		if type(self.container) is not str:
			self.container = str(self.container)

		self.container = self.container.replace('..', '')
		self.container = self.container.strip('/')

		if not self.container: self.container = ""
示例#4
0
文件: update.py 项目: The-CJ/PhaazeDB
    def getUpdate(self, DBReq: DBRequest) -> None:
        self.content = DBReq.get("content", None)

        if type(self.content) is dict:
            self.method = "dict"
        elif type(self.content) is str:
            self.method = "str"
        else:
            raise MissingUpdateContent()
示例#5
0
文件: delete.py 项目: The-CJ/PhaazeDB
    def getContainter(self, DBReq: DBRequest) -> None:
        self.container = DBReq.get("of", "")
        if type(self.container) is not str:
            self.container = str(self.container)

        self.container = self.container.replace('..', '')
        self.container = self.container.strip('/')

        if not self.container: raise MissingOfField()
示例#6
0
    def getPath(self, DBReq: DBRequest) -> None:
        self.path = DBReq.get("path", "")
        if type(self.path) is not str:
            self.path = str(self.path)

        self.path = self.path.replace('..', '')
        self.path = self.path.strip('/')

        if not self.path: self.path = ""
示例#7
0
文件: drop.py 项目: The-CJ/PhaazeDB
    def getContainterName(self, DBReq: DBRequest):
        self.container = DBReq.get("name", "")
        if type(self.container) is not str:
            self.container = str(self.container)

        self.container = self.container.replace('..', '')
        self.container = self.container.strip('/')

        if not self.container: raise MissingNameField()
示例#8
0
文件: delete.py 项目: The-CJ/PhaazeDB
    def getLimit(self, DBReq: DBRequest) -> None:
        self.limit = DBReq.get("limit", math.inf)
        if type(self.limit) is str:
            if self.limit.isdigit():
                self.limit = int(self.limit)

        if type(self.limit) is not int:
            self.limit = math.inf

        if self.limit <= 0:
            raise InvalidLimit()
示例#9
0
文件: insert.py 项目: The-CJ/PhaazeDB
    def getContent(self, DBReq: DBRequest) -> None:
        self.content = DBReq.get("content", None)

        if type(self.content) is str:
            try:
                self.content = json.loads(self.content)
            except:
                raise InvalidContent()

        if type(self.content) is not dict:
            raise InvalidContent()
示例#10
0
    def getContainterTemplate(self, DBReq: DBRequest) -> None:
        self.default_content = DBReq.get("content", "")

        if type(self.default_content) is str:
            try:
                self.default_content = json.loads(self.default_content)
            except:
                raise InvalidContent()

        if type(self.default_content) is not dict:
            raise InvalidContent()
示例#11
0
    async def authorise(self, DBReq: DBRequest) -> bool:
        token: str = DBReq.get("token", None)
        if token:
            token = password(token)

        db_token: str = self.PhaazeDBS.token
        if not db_token: return True

        if token != db_token:
            return False
        else:
            return True
示例#12
0
 def getValue(self, DBReq: DBRequest):
     self.value = DBReq.get("value", None)
     if not self.value:
         self.value = None
示例#13
0
	def getRecursive(self, DBReq:DBRequest) -> None:
		self.recursive = DBReq.get("recursive",None)
		if type(self.recursive) is not bool:
			self.recursive = bool(self.recursive)
示例#14
0
文件: delete.py 项目: The-CJ/PhaazeDB
 def getStore(self, DBReq: DBRequest) -> None:
     self.store = DBReq.get("store", None)
     if type(self.store) is not str:
         self.store = None
示例#15
0
 def getIgnore(self, DBReq: DBRequest) -> None:
     self.ignore_errors = DBReq.get("ignore_errors", None)
     if type(self.ignore_errors) is not bool:
         self.ignore_errors = bool(self.ignore_errors)
示例#16
0
文件: delete.py 项目: The-CJ/PhaazeDB
 def getWhere(self, DBReq: DBRequest) -> None:
     self.where = DBReq.get("where", "")
示例#17
0
 def getFile(self, DBReq: DBRequest) -> None:
     self.fileObject = DBReq.get("phzdb", None)
     if not self.fileObject: raise MissingImportFile()
示例#18
0
    def getOption(self, DBReq: DBRequest):
        self.option = DBReq.get("option", None)
        if type(self.option) is not str:
            self.option = None

        if not self.option: raise MissingOptionField()
示例#19
0
文件: insert.py 项目: The-CJ/PhaazeDB
    def getContainter(self, DBReq: DBRequest) -> None:
        self.container = DBReq.get("into", "")
        self.container = self.container.replace('..', '')
        self.container = self.container.strip('/')

        if not self.container: raise MissingIntoField()