view modules/web_view/display_issues_techintern.py @ 45:8449509b7f6f

Limit time frame of graph Requires roundup_cc ≥ 99e2e0e17103.
author Gernot Schulz <gernot@intevation.de>
date Sun, 31 Jan 2016 15:32:35 +0100
parents 2e2981af7d2d
children ba41c0fbd6e7
line wrap: on
line source
#!/usr/bin/env python3

""" Fetch issues from a roundup-tracker and save them in a databse.

author: Sascha L. Teichmann <sascha.teichmann@intevation.de>
author: Bernhard Reiter <bernhard@intevation.de>
author: Sean Engelhardt <sean.engelhardt@intevation.de>

(c) 2010,2015 by Intevation GmbH

This is Free Software unter the terms of the
GNU GENERAL PUBLIC LICENSE Version 3 or later.
See http://www.gnu.org/licenses/gpl-3.0.txt for details
"""

from sys import path
import os

path.append(
        os.path.join(os.path.dirname(os.path.realpath(__file__)), 'roundup_cc')
    )

from display_issues import *

graph = os.path.dirname(os.path.realpath(__file__)) + '/bottledash_graph.html'

def get_chart(target_div_name):
    html_string = compile_db_stats_html(
        rcd.DATABASE_TECH_INTERN,
        rcd.SELECT_WHERE.format("timestamp > date('now', '-2 month')"),
        graph
    )

    html_string = html_string.replace(
        'var d3jsInjectionTarget="X";', 'var d3jsInjectionTarget="' + target_div_name + '";')

    return html_string

# print(get_chart('techintern'))
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)