(view_func)
return _wrapped
Use this decorator on the dispatch method of a TemplateView subclass
    to enable the inclusion of the daterangepicker library at the base template
    level.

    Example:

    @use_daterangepicker
    def dispatch(self, request, *args, **kwargs):
        return super(MyView, self).dispatch(request, *args, **kwargs)
Use this decorator on the dispatch method of a TemplateView subclass
    to enable the inclusion of the daterangepicker library at the base template
    level.
Use this decorator on the dispatch method of a TemplateView subclass to enable the inclusion of the daterangepicker library at the base template level .
def use_daterangepicker(view_func):
    """Use this decorator on the dispatch method of a TemplateView subclass
    to enable the inclusion of the daterangepicker library at the base template
    level.

    Example:

    @use_daterangepicker
    def dispatch(self, request, *args, **kwargs):
        return super(MyView, self).dispatch(request, *args, **kwargs)
    """

    @wraps(view_func)
    def _wrapped(*args, **kwargs):
        if hasattr(args[0], 'META'):
            # function view
            request = args[0]
        else:
            # class view
            request = args[1]
        request.use_daterangepicker = True
        return view_func(*args, **kwargs)
    return _wrapped
def use_daterangepicker ( view_func ) : @ wraps ( view_func ) def _wrapped ( * args , * * kwargs ) : if hasattr ( args [ 0 ] , 'META' ) : # function view request = args [ 0 ] else : # class view request = args [ 1 ] request . use_daterangepicker = True return view_func ( * args , * * kwargs ) return _wrapped