Exemplo n.º 1
0
def getSidebar(id, user):
  """Constructs a sidebar for the current user.
  """

  sidebar = []

  for callback in SIDEBAR:
    menus = callback(id, user)

    for menu in (menus if menus else []):
      sidebar.append(menu)

  return sorted(sidebar, key=lambda x: x.get('group'))
Exemplo n.º 2
0
    def getSidebar(self, id, user):
        """Constructs a sidebar for the current user.
    """

        self.callService('registerWithSidebar', True)

        sidebar = []

        for i in self.sidebar:
            menus = i(id, user)

            for menu in (menus if menus else []):
                sidebar.append(menu)

        return sorted(sidebar, key=lambda x: x.get('group'))
Exemplo n.º 3
0
  def getSidebar(self, id, user):
    """Constructs a sidebar for the current user.
    """

    self.callService('registerWithSidebar', True)

    sidebar = []

    for i in self.sidebar:
      menus = i(id, user)

      for menu in (menus if menus else []):
        sidebar.append(menu)

    return sorted(sidebar, key=lambda x: x.get('group'))