def view(request): session = DBSession() query = session.query(ResearchObject) search_pattern = request.params.get("main_search", "") if search_pattern != "": query = query.filter(ResearchObject.name.like("%s%%" % search_pattern)) return {'ros': query.all(), 'search_pattern': search_pattern, 'links': session.query(ROLink).all()}
def view(request): session = DBSession() query = session.query(User) search_pattern = request.params.get("main_search", "") if search_pattern != "": query = query.filter(User.id.like("%s%%" % search_pattern)) return {'users': query.all(), 'search_pattern': search_pattern}
def view(request): session = DBSession() query = session.query(Team) search_pattern = request.params.get("main_search", "") if search_pattern != "": query = query.filter(Team.id.like("%s%%" % search_pattern)) query = query.order_by(Team.id) teams = query.all() return {'teams': teams, 'search_pattern': search_pattern}
def view(request): session = DBSession() # gather data src = request.params["source"] tgt = request.params["target"] link_type = request.params["link_type"] # test ownership # TODO # find link query = session.query(ROLink) query = query.filter(ROLink.source == src) query = query.filter(ROLink.target == tgt) query = query.filter(ROLink.type == link_type) link, = query.all() ROLink.remove(session, link) return True