예제 #1
0
    def __call__(self, environ, start_response):

        chart_id = self.extract_chart_id(environ['PATH_INFO'])

        chart = Chart.by_primary_key(self.dbconn, chart_id)

        start_response('200 OK',
                       [('Content-Type', 'text/html; charset=utf-8')])

        t = self.templates.get_template('chart.html')

        return [t.render(chart=chart, app_id=self.config_wrapper.app_id)]
예제 #2
0
    def __call__(self, environ, start_response):

        chart_id = self.extract_chart_id(environ['PATH_INFO'])

        chart = Chart.by_primary_key(self.dbconn, chart_id)

        start_response(
            '200 OK',
            [('Content-Type', 'text/html; charset=utf-8')])

        t = self.templates.get_template('chart.html')

        return [t.render(chart=chart,
            app_id=self.config_wrapper.app_id)]
예제 #3
0
    def __call__(self, environ, start_response):

        chart_id = self.extract_chart_id(environ['PATH_INFO'])

        chart = Chart.by_primary_key(self.dbconn, chart_id)

        action = self.extract_action(environ['PATH_INFO'])

        action(chart, self.dbconn)

        redirect_target = (
            '%s/chart/%d' %
            (self.config_wrapper.parsed_config['server']['host'], chart_id))

        start_response('302 FOUND', [('Location', redirect_target)])

        return []
예제 #4
0
    def __call__(self, environ, start_response):

        chart_id = self.extract_chart_id(environ['PATH_INFO'])

        chart = Chart.by_primary_key(self.dbconn, chart_id)

        action = self.extract_action(environ['PATH_INFO'])

        action(chart, self.dbconn)

        redirect_target = (
            '%s/chart/%d'
            % (
                self.config_wrapper.parsed_config['server']['host'],
                chart_id))

        start_response(
        '302 FOUND',
        [('Location', redirect_target)])

        return []