code: def init_with_context(self, context):
          
          # Apply the include/exclude patterns:
          listitems = self._visible_models(context['request'])
  
          # Convert to a similar data structure like the dashboard icons have.
          # This allows sorting the items identically.
          models = [
              {'name': model._meta.model_name,
               'app_name': model._meta.app_label,
               'title': capfirst(model._meta.verbose_name_plural),
               'url': self._get_admin_change_url(model, context)
               }
              for model, perms in listitems if self.is_item_visible(model, perms)
          ]
  
          # Sort models.
          sort_cms_models(models)
  
          # Convert to items
          for model in models:
              self.children.append(items.MenuItem(title=model['title'], url=model['url']))
docs: Initialize the menu.