def update_website(self): from selling.utils.product import invalidate_cache_for invalidate_cache_for(self.doc.item_group) [invalidate_cache_for(d.item_group) for d in \ self.doclist.get({"doctype":"Website Item Group"})] WebsiteGenerator.on_update(self)
def on_update(self): WebsiteGenerator.on_update(self) # clear all cache if it has toc if self.doclist.get({"parentfield": "toc"}): from webnotes.webutils import clear_cache clear_cache()
def on_update(self): WebsiteGenerator.on_update(self) self.if_home_clear_cache() # clear all cache if it has toc if self.doclist.get({"parentfield": "toc"}): from webnotes.webutils import clear_cache clear_cache()
def on_update(self): DocTypeNestedSet.on_update(self) WebsiteGenerator.on_update(self) self.validate_name_with_item() from selling.utils.product import invalidate_cache_for invalidate_cache_for(self.doc.name) self.validate_one_root()
def on_trash(self): # delete entry from Table of Contents of other pages WebsiteGenerator.on_trash(self) webnotes.conn.sql("""delete from `tabTable of Contents` where web_page=%s""", self.doc.name) # clear all cache if it has toc if self.doclist.get({"parentfield": "toc"}): from webnotes.webutils import clear_cache clear_cache()
def if_home_clear_cache(self): """if home page, clear cache""" if webnotes.conn.get_value("Website Settings", None, "home_page")==self.doc.name: if webnotes.conn.exists("Website Sitemap", "index"): webnotes.delete_doc("Website Sitemap", "index", ignore_permissions=True) WebsiteGenerator.on_update(self, page_name="index") from webnotes.sessions import clear_cache clear_cache('Guest') from webnotes.webutils import clear_cache clear_cache(self.doc.page_name) clear_cache('index')
def on_trash(self): webnotes.conn.sql("""delete from tabBin where item_code=%s""", self.doc.item_code) WebsiteGenerator.on_trash(self)
def on_update(self): WebsiteGenerator.on_update(self) webnotes.webutils.delete_page_cache("writers")
def on_update(self): WebsiteGenerator.on_update(self) if self.doc.page_name: clear_cache("partners")
def on_update(self): WebsiteGenerator.on_update(self) clear_cache("writers")