(request, placeholder_uid, position, workspace=None)
Paste the dashboard entry from clipboard if any available.

    :param django.http.HttpRequest request:
    :param str placeholder_uid:
    :param int position:
    :param str workspace: Workspace slug.
    :return django.http.HttpResponse:
Paste the dashboard entry from clipboard if any available.
Paste the dashboard entry from clipboard if any available .
def paste_dashboard_entry(request, placeholder_uid, position, workspace=None):
    """Paste the dashboard entry from clipboard if any available.

    :param django.http.HttpRequest request:
    :param str placeholder_uid:
    :param int position:
    :param str workspace: Workspace slug.
    :return django.http.HttpResponse:
    """
    # Getting dashboard settings for the user. Then get users' layout.
    dashboard_settings = get_or_create_dashboard_settings(request.user)
    layout = get_layout(
        layout_uid=dashboard_settings.layout_uid,
        as_instance=True
    )

    try:
        plugin_uid, success = paste_entry_from_clipboard(
            request,
            layout,
            placeholder_uid,
            position,
            workspace=workspace
        )
    except Exception as err:
        plugin_uid, success = str(err), False

    if plugin_uid and success:
        plugin = plugin_registry.get(plugin_uid)
        messages.info(
            request,
            _('The dashboard entry "{0}" was successfully pasted from '
              'clipboard.').format(safe_text(plugin.name))
        )
    else:
        # In case if not success, ``plugin_uid`` would be holding the error
        # message.
        messages.info(
            request,
            _('Problems occurred while pasting from '
              'clipboard. {0}'.format(safe_text(plugin_uid)))
        )

    if workspace:
        return redirect('dash.edit_dashboard', workspace=workspace)
    else:
        return redirect('dash.edit_dashboard')
def paste_dashboard_entry ( request , placeholder_uid , position , workspace = None ) : # Getting dashboard settings for the user. Then get users' layout. dashboard_settings = get_or_create_dashboard_settings ( request . user ) layout = get_layout ( layout_uid = dashboard_settings . layout_uid , as_instance = True ) try : plugin_uid , success = paste_entry_from_clipboard ( request , layout , placeholder_uid , position , workspace = workspace ) except Exception as err : plugin_uid , success = str ( err ) , False if plugin_uid and success : plugin = plugin_registry . get ( plugin_uid ) messages . info ( request , _ ( 'The dashboard entry "{0}" was successfully pasted from ' 'clipboard.' ) . format ( safe_text ( plugin . name ) ) ) else : # In case if not success, ``plugin_uid`` would be holding the error # message. messages . info ( request , _ ( 'Problems occurred while pasting from ' 'clipboard. {0}' . format ( safe_text ( plugin_uid ) ) ) ) if workspace : return redirect ( 'dash.edit_dashboard' , workspace = workspace ) else : return redirect ( 'dash.edit_dashboard' )