def _handle_create(self): path = self.request.get('path') data = self.request.get('data').replace(' ', '\t') title = self.request.get('title') add_script(self.request, 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js') add_script(self.request, '/htdocs/jquery.tabby.js') self.response.out.write(self.env.get_template('proposal_create.html').render(locals()))
def get(self): path = self.request.get('path') title = path f = File.from_path(path) if not f: send_error(self, '%s not found', path) return mime_type, encoding = mimetypes.guess_type(f.path, False) if mime_type.startswith('text'): data = f.data.replace(' ', '\t') add_script(self.request, 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js') add_script(self.request, '/htdocs/jquery.tabby.js') self.response.out.write(self.env.get_template('proposal_create.html').render(locals())) else: user_props = Proposal.all().filter('state', 'private').filter('user', user.user).fetch(100) self.response.out.write(self.env.get_template('proposal_create_binary.html').render(locals()))