def get(self, request, *args, **kwargs): """ used in get method calls """ self.elfinder = ElfinderConnector(self.get_optionset(**kwargs), request.session) return self.output(self.get_command(request.GET), request.GET)
def post(self, request, *args, **kwargs): """ called in post method calls. It only allows for the 'upload' command """ self.elfinder = ElfinderConnector(self.get_optionset(**kwargs), request.session) cmd = self.get_command(request.POST) if not cmd in ['upload']: self.render_to_response({ 'error': self.elfinder.error( ElfinderErrorMessages.ERROR_UPLOAD, ElfinderErrorMessages.ERROR_UPLOAD_TOTAL_SIZE) }) return self.output(cmd, request.POST)