(parser, token)
return GetDashWorkspacesNode(layout_uid=layout_uid, edit_mode=edit_mode)
Get the workspaces queryset

    :syntax:

        {% get_dash_workspaces [layout_uid] mode [edit_mode] %}

    :example:

        {% get_dash_workspaces layout.uid %}

        {% get_dash_workspaces layout.uid 1 %}
Get the workspaces queryset
Get the workspaces queryset
def get_dash_workspaces(parser, token):
    """Get the workspaces queryset

    :syntax:

        {% get_dash_workspaces [layout_uid] mode [edit_mode] %}

    :example:

        {% get_dash_workspaces layout.uid %}

        {% get_dash_workspaces layout.uid 1 %}
    """
    bits = token.contents.split()

    if len(bits) not in (1, 2, 3, 4):
        raise TemplateSyntaxError(
                "Invalid syntax for {0}. Incorrect number "
                "of arguments.".format(bits[0])
        )

    if 4 == len(bits):
        layout_uid = parser.compile_filter(bits[1])
        edit_mode = bits[-1]

    elif 3 == len(bits):
        layout_uid = None
        edit_mode = bits[-1]

    elif 2 == len(bits):
        layout_uid = parser.compile_filter(bits[1])
        edit_mode = False

    return GetDashWorkspacesNode(layout_uid=layout_uid, edit_mode=edit_mode)
def get_dash_workspaces ( parser , token ) : bits = token . contents . split ( ) if len ( bits ) not in ( 1 , 2 , 3 , 4 ) : raise TemplateSyntaxError ( "Invalid syntax for {0}. Incorrect number " "of arguments." . format ( bits [ 0 ] ) ) if 4 == len ( bits ) : layout_uid = parser . compile_filter ( bits [ 1 ] ) edit_mode = bits [ - 1 ] elif 3 == len ( bits ) : layout_uid = None edit_mode = bits [ - 1 ] elif 2 == len ( bits ) : layout_uid = parser . compile_filter ( bits [ 1 ] ) edit_mode = False return GetDashWorkspacesNode ( layout_uid = layout_uid , edit_mode = edit_mode )