# Path: invoicing/views.py
# class InvoiceDetailView(DetailView):
#     model = Invoice
# 
#     @method_decorator(login_required)
#     def dispatch(self, request, *args, **kwargs):
#         if not request.user.is_active and not request.user.is_superuser:
#             return HttpResponseForbidden()
# 
#         invoice = get_object_or_404(self.model, pk=kwargs.get('pk', None))
# 
#         invoicing_formatter = getattr(settings, 'INVOICING_FORMATTER', 'invoicing.formatters.html.BootstrapHTMLFormatter')
#         formatter_class = import_name(invoicing_formatter)
#         formatter = formatter_class(invoice)
#         return formatter.get_response()


from django.conf.urls import url
from invoicing.views import InvoiceDetailView



app_name = 'invoicing'

urlpatterns = [
    url(r'^invoice/detail/(?P<pk>[-\d]+)/$', InvoiceDetailView.as_view(), name='invoice_detail'),

# Path: invoicing/views.py
# class InvoiceDetailView(DetailView):
#     model = Invoice
# 
#     @method_decorator(login_required)
#     def dispatch(self, request, *args, **kwargs):
#         if not request.user.is_active and not request.user.is_superuser:
#             return HttpResponseForbidden()
# 
#         invoice = get_object_or_404(self.model, pk=kwargs.get('pk', None))
# 
#         invoicing_formatter = getattr(settings, 'INVOICING_FORMATTER', 'invoicing.formatters.html.BootstrapHTMLFormatter')
#         formatter_class = import_name(invoicing_formatter)
#         formatter = formatter_class(invoice)
#         return formatter.get_response()


# Path: invoicing/urls.py
from django.conf.urls import url
from invoicing.views import InvoiceDetailView




app_name = 'invoicing'

urlpatterns = [
    url(r'^invoice/detail/(?P<pk>[-\d]+)/$', InvoiceDetailView.as_view(), name='invoice_detail'),

]