(subpages, level, domain=None)
return [dropdown_dict(
            subpage['title'],
            url=reverse(subpage['urlname'], args=[domain]))
            for subpage in subpages if is_dropdown(subpage)]
formats subpages of a sidebar_item as 1st or 2nd level dropdown items
        depending on if level is 1 or 2 respectively
formats subpages of a sidebar_item as 1st or 2nd level dropdown items
        depending on if level is 1 or 2 respectively
formats subpages of a sidebar_item as 1st or 2nd level dropdown items depending on if level is 1 or 2 respectively
def subpages_as_dropdowns(subpages, level, domain=None):
    """
        formats subpages of a sidebar_item as 1st or 2nd level dropdown items
        depending on if level is 1 or 2 respectively
    """
    def is_dropdown(subpage):
        if subpage.get('show_in_dropdown', False) and level == 1:
            return subpage.get('show_in_first_level', False)
        elif subpage.get('show_in_dropdown', False) and level == 2:
            return not subpage.get('show_in_first_level', False)

    return [dropdown_dict(
            subpage['title'],
            url=reverse(subpage['urlname'], args=[domain]))
            for subpage in subpages if is_dropdown(subpage)]
def subpages_as_dropdowns ( subpages , level , domain = None ) : def is_dropdown ( subpage ) : if subpage . get ( 'show_in_dropdown' , False ) and level == 1 : return subpage . get ( 'show_in_first_level' , False ) elif subpage . get ( 'show_in_dropdown' , False ) and level == 2 : return not subpage . get ( 'show_in_first_level' , False ) return [ dropdown_dict ( subpage [ 'title' ] , url = reverse ( subpage [ 'urlname' ] , args = [ domain ] ) ) for subpage in subpages if is_dropdown ( subpage ) ]