code: def get_pages_for_display(self):
          
  
          # Start with an empty queryset, and expand as needed
          all_pages = Page.objects.none()
  
          if self.max_levels == 1:
              # If no additional sub-levels are needed, return empty queryset
              return all_pages
  
          for item in self.top_level_items:
  
              if item.link_page_id:
                  # Fetch a 'branch' of suitable descendants for this item and
                  # add to 'all_pages'
                  page_depth = item.link_page.depth
                  if(
                      item.allow_subnav and
                      page_depth >= settings.SECTION_ROOT_DEPTH
                  ):
                      all_pages = all_pages | Page.objects.filter(
                          depth__gt=page_depth,
                          depth__lt=page_depth + self.max_levels,
                          path__startswith=item.link_page.path)
  
          # Filter the entire queryset to include only pages suitable for display
          all_pages = all_pages & self.get_base_page_queryset()
  
          # Return 'specific' page instances if required
          if self.use_specific == constants.USE_SPECIFIC_ALWAYS:
              return all_pages.specific()
  
          return all_pages
docs: Return all pages needed for rendering all sub-levels for the current
          menu