def save_toc(toc): global toc_cache toc_cache = toc sefaria.db.summaries.remove({"name": "toc"}) sefaria.db.summaries.save({"name": "toc", "contents": toc}) sefaria.delete_template_cache("texts_list")
def save_toc(toc): """ Saves the table of contents object to in-memory cache, invalidtes texts_list cache. """ global toc_cache toc_cache = toc sefaria.delete_template_cache("texts_list")
def save_toc(toc): global toc_cache toc_cache = toc sefaria.delete_template_cache("texts_list")