def on_update(self): WebsiteGenerator.on_update(self) # clear all cache if it has toc if self.doclist.get({"parentfield": "toc"}): from frappe.website.render import clear_cache clear_cache()
def set_parent_website_route(self): """Overwrite `parent_website_route` from `WebsiteGenerator`. Only set `parent_website_route` if parent is visble. e.g. If `show_in_website` is set for Products then url should be `/products`""" if self.parent_item_group and frappe.db.get_value("Item Group", self.parent_item_group, "show_in_website"): WebsiteGenerator.set_parent_website_route(self) else: self.parent_website_route = ""
def on_trash(self): # delete entry from Table of Contents of other pages WebsiteGenerator.on_trash(self) frappe.db.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 frappe.website.render import clear_cache clear_cache()
def on_trash(self): NestedSet.on_trash(self) WebsiteGenerator.on_trash(self)
def after_rename(self, olddn, newdn, merge=False): NestedSet.after_rename(self, olddn, newdn, merge) WebsiteGenerator.after_rename(self, olddn, newdn, merge)
def on_update(self): NestedSet.on_update(self) WebsiteGenerator.on_update(self) invalidate_cache_for(self) self.validate_name_with_item() self.validate_one_root()
def on_update(self): WebsiteGenerator.on_update(self) clear_cache("writers")
def on_trash(self): NestedSet.on_trash(self) WebsiteGenerator.on_trash(self) self.delete_child_item_groups_key()
def on_update(self): WebsiteGenerator.on_update(self) NestedSet.on_update(self) clear_cache(website_group=self.name)
def scrub(text): return WebsiteGenerator.scrub(None, text)
def on_update(self): WebsiteGenerator.on_update(self) clear_cache(website_group=self.name)