def _generate_cgitb_error(self, request, original_response, exc_type, exc_value, tb): if os.environ.get('DAE_ENV') == 'SDK': traceback.print_exc() return st('/errors/500.html', **locals()) traceback.print_exc() return st('/errors/500.html', **locals())
def _q_exception_handler(request, exception): if isinstance(exception, TraversalError): error = exception return st('/errors/404.html', **locals()) if isinstance(exception, AccessError): error = exception return st('/errors/401.html', **locals()) else: raise exception
def _q_index(request): tdt = dict() if request.method == "POST": name = request.get_form_var('name') description = request.get_form_var('description') creator_id = int(request.get_form_var('creator_id', 1)) o = Organization.add(name=name, description=description, owner_id=creator_id, creator_id=creator_id) if o: return request.redirect('organizations/%s' % o.name) tdt['organization'] = o return st('organizations/index.html', **tdt) organizations = Organization.gets_by() tdt['organizations'] = organizations return st('organizations/index.html', **tdt)
def _q_index(request): session = request.session tdt = {} tdt['session'] = session tdt['current_user'] = User.get_by(id=session.user) if session else None if request.method == 'POST': session.set_user(None) return request.redirect('/') return st('logout.html', **tdt)
def _q_index(request): if request.method == 'POST': name = request.get_form_var('login') password = request.get_form_var('password') user = User.get_by_name(name) if user and user.validate_password(password): session = request.session session.set_user(user.id) return request.redirect('/') return st('login.html')
def _q_index(request): tdt = dict() session = request.session current_user = User.get_by(session.user) if session else None if current_user and request.method == "POST": name = request.get_form_var('name') description = request.get_form_var('description') p = Project.add(name=name, description=description, owner_id=current_user.id, creator_id=current_user.id) if p: return request.redirect('projects/%s' % p.name) tdt['project'] = p return st('projects/index.html', **tdt) projects = Project.gets_by() tdt['projects'] = projects tdt['current_user'] = User.get_by(id=session.user) if session else None return st('projects/index.html', **tdt)
def _q_index(request): tdt = dict() if request.method == "POST": name = request.get_form_var('name') password = request.get_form_var('password') email = request.get_form_var('email') description = request.get_form_var('description') user = User.add(name=name, password=password, description=description, email=email) if user: tdt['user'] = user session = request.session session.set_user(user.id) return request.redirect('/') users = User.gets_by() tdt['users'] = users return st('users/index.html', **tdt)
def _q_index(self, request): tdt = dict() tdt['organization'] = self.organization return st('organizations/org.html', **tdt)
def render_action(action, is_notify, show_avatar): return st('widgets/feed_action.html', **locals())
def _q_index(request): return st('users/new.html')
def render_message(message): return st('widgets/chat_message.html', **locals())
def render_actions(actions, show_avatar, is_render_actions=True, is_collapsed=True): return st('widgets/actions_feed.html', **locals())
def _q_index(self, request): tdt = dict() session = request.session tdt['project'] = self.project tdt['current_user'] = User.get_by(id=session.user) if session else None return st('/projects/repo.html', **tdt)
def _q_index(request): tdt = dict() session = request.session tdt['users'] = User.gets_by() tdt['current_user'] = User.get_by(id=session.user) if session else None return st('projects/new.html', **tdt)
def _q_index(request): tdt = {} session = request.session tdt['session'] = session tdt['current_user'] = User.get_by(id=session.user) if session else None return st("index.html", **tdt)
def _q_index(request): tdt = dict() return st('organizations/new.html', **tdt)