Пример #1
0
    def test_report_registery(self):
        from .reports import ProductClientSales
        from ra.reporting.registry import report_registry
        from ra.reporting.registry import register_report_view

        class ProductClientSales2(ProductClientSales):
            report_slug = 'client_sales_of_products_2'

        register_report_view(ProductClientSales2)
        report = report_registry.get('client', 'client_sales_of_products_2')
        self.assertIsNotNone(report)
Пример #2
0
def get_report_view(request, base_model, report_slug):
    from ra.reporting.registry import report_registry
    klass = report_registry.get(base_model, report_slug)
    return klass.as_view()(request)
Пример #3
0
def get_report(context, base_model, report_slug):
    from ra.reporting.registry import report_registry
    return report_registry.get(namespace=base_model, report_slug=report_slug)