@handle_response_format
@treeio_login_required
def dashboard_widget_add(request, module_name=None, widget_name=None, response_format='html'):
    trash = Object.filter_by_request(request, manager=Object.objects.filter(trash=True),
                                     mode='r', filter_trash=False).count()

    if module_name and widget_name:
        widget = _create_widget_object(request, module_name, widget_name)
        if widget:
            return HttpResponseRedirect(reverse('core_dashboard_index'))

    widgets = _get_all_widgets(request)

    return render_to_response('core/dashboard/widget_add',
                              {'trash': trash,
                               'widgets': widgets},
                              context_instance=RequestContext(request), response_format=response_format)
Add a Widget to the Dashboard
dataset/ETHPy150Open treeio/treeio/treeio/core/dashboard/views.py/dashboard_widget_add