def reports_api(request, registry_key, report_id=None):
    from autoreports.registry import report_registry
    api = report_registry.get_api_class(registry_key)
    report = None
    if report_id:
        report = get_object_or_404(Report, pk=report_id)
    return api.report(request, report=report, extra_context={'registry_key': registry_key})
Beispiel #2
0
def reports_api_wizard(request, registry_key, report_id=None):
    from autoreports.registry import report_registry
    api = report_registry.get_api_class(registry_key)
    report = None
    if report_id:
        report = get_object_or_404(Report, pk=report_id)
    return api.report_api_wizard(request,
                                 report=report,
                                 extra_context={'registry_key': registry_key})
def reports_api_list(request, registry_key):
    from autoreports.registry import report_registry
    api = report_registry.get_api_class(registry_key)
    ct = ContentType.objects.get_for_model(api.model)
    reports = Report.objects.filter(content_type=ct)
    return render_to_response('autoreports/autoreports_report_list.html',
                              {'reports': reports,
                               'report_key': registry_key,
                               'template_base': getattr(settings, 'AUTOREPORTS_BASE_TEMPLATE', 'base.html'),
                              },
                              context_instance=RequestContext(request))
Beispiel #4
0
def reports_api_list(request, registry_key):
    from autoreports.registry import report_registry
    api = report_registry.get_api_class(registry_key)
    ct = ContentType.objects.get_for_model(api.model)
    reports = Report.objects.filter(content_type=ct)
    return render_to_response('autoreports/autoreports_report_list.html', {
        'reports':
        reports,
        'report_key':
        registry_key,
        'template_base':
        getattr(settings, 'AUTOREPORTS_BASE_TEMPLATE', 'base.html'),
    },
                              context_instance=RequestContext(request))