code: def create_recomended_articles(main_article, article_list):
      '''
      Creates recommended article objects from article_list
      and _prepends_ to existing recommended articles.
      '''
  
      # store existing recommended articles
      existing_recommended_articles = [
          ra.recommended_article.specific
          for ra in main_article.recommended_articles.all()]
      # delete existing recommended articles
      ArticlePageRecommendedSections.objects.filter(page=main_article).delete()
  
      for hyperlinked_article in article_list:
          ArticlePageRecommendedSections(
              page=main_article,
              recommended_article=hyperlinked_article).save()
  
      # re-create existing recommended articles
      for article in existing_recommended_articles:
          if article not in article_list:
              ArticlePageRecommendedSections(
                  page=main_article,
                  recommended_article=article).save(f create_recomended_articles(main_article, article_list):
      '''
      Creates recommended article objects from article_list
      and _prepends_ to existing recommended articles.
      '''
  
      # store existing recommended articles
      existing_recommended_articles = [
          ra.recommended_article.specific
          for ra in main_article.recommended_articles.all()]
      # delete existing recommended articles
      ArticlePageRecommendedSections.objects.filter(page=main_article).delete()
  
      for hyperlinked_article in article_list:
          ArticlePageRecommendedSections(
              page=main_article,
              recommended_article=hyperlinked_article).save()
  
      # re-create existing recommended articles
      for article in existing_recommended_articles:
          if article not in article_list:
              ArticlePageRecommendedSections(
                  page=main_article,
                  recommended_article=article).save()
docs: Creates recommended article objects from article_list
      and _prepends_ to existing recommended articles.