def METHOD_NAME(ranking, pages_list):
    ranking.pages.all().delete()
    for nr, page_data in enumerate(pages_list, 1):
        page = RankingPage(ranking=ranking, nr=nr, data=page_data)
        page.save()