Ejemplo n.º 1
0
def report_list(request):
    """Automated report list view"""

    key = itemgetter(1)

    reports = ReportList(CONFIG_FILE_PACKAGE).get_report_list()
    reports.sort(key=key)

    reports_local = ReportList(CONFIG_FILE_LOCAL).get_report_list()
    reports_local.sort(key=key)

    context = {
        'title':
        'Report - Report List',
        'navpath': [
            ('Home', '/'),
            ('Report', '/report/'),
            ('Report List', '/report/reportlist'),
        ],
        'heading':
        'Report list',
        'report_list':
        reports,
        'report_list_local':
        reports_local
    }

    return render_to_response('report/report_list.html', context,
                              RequestContext(request))
Ejemplo n.º 2
0
    def get_context_data(self, **kwargs):
        context = super(ReportWidget, self).get_context_data(**kwargs)
        navlet = AccountNavlet.objects.get(pk=self.navlet_id)
        report_id = navlet.preferences.get('report_id')
        query_string = navlet.preferences.get('query_string')

        if self.mode == NAVLET_MODE_EDIT:
            report_list = ReportList(
                list_config_files_from_dir(CONFIG_DIR)
            ).get_report_list()

            context['report_list'] = report_list
            context['current_report_id'] = report_id
            context['query_string'] = query_string
        elif self.mode == NAVLET_MODE_VIEW:
            full_context = make_report(
                self.request,
                report_id,
                None,
                QueryDict(query_string).copy(),
                paginate=False,
            )
            if full_context:
                report = full_context.get('report')
                context['report'] = report
                context['page'] = report.table.rows

        return context
Ejemplo n.º 3
0
def report_list(request):
    """Automated report list view"""

    key = itemgetter(1)

    reports = ReportList(CONFIG_FILE_PACKAGE).get_report_list()
    reports.sort(key=key)

    reports_local = ReportList(CONFIG_FILE_LOCAL).get_report_list()
    reports_local.sort(key=key)

    context = {
        'title': 'Report - Report List',
        'navpath': [
            ('Home', '/'),
            ('Report', '/report/'),
            ('Report List', '/report/reportlist'),
        ],
        'heading': 'Report list',
        'report_list': reports,
        'report_list_local': reports_local,
    }

    return render_to_response('report/report_list.html', context,
                              RequestContext(request))
Ejemplo n.º 4
0
def report_list(request):
    """Automated report list view"""
    report_list = ReportList(
        list_config_files_from_dir(CONFIG_DIR)).get_report_list()

    context = {
        'title':
        'Report - Report List',
        'navpath': [
            ('Home', '/'),
            ('Report', '/report/'),
            ('Report List', '/report/reportlist'),
        ],
        'heading':
        'Report list',
        'report_list':
        report_list,
    }

    return render(request, 'report/report_list.html', context)
Ejemplo n.º 5
0
def report_list():
    result = ReportList(config_file)
    return [report[0] for report in result.reports]
Ejemplo n.º 6
0
def test_report_generator():
    report_list = ReportList(config_file)
    for report in report_list.reports:
        report_name = report[0]
        yield report_name, check_report, report_name
Ejemplo n.º 7
0
def report_list():
    result = ReportList(list_config_files_from_dir(config_files_dir))
    return [report.id for report in result.reports]