示例#1
0
    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()
示例#2
0
	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 = ""
示例#3
0
	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 = ""
示例#4
0
    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()
示例#5
0
 def on_trash(self):
     NestedSet.on_trash(self)
     WebsiteGenerator.on_trash(self)
示例#6
0
 def after_rename(self, olddn, newdn, merge=False):
     NestedSet.after_rename(self, olddn, newdn, merge)
     WebsiteGenerator.after_rename(self, olddn, newdn, merge)
示例#7
0
 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")
示例#9
0
	def on_update(self):
		WebsiteGenerator.on_update(self)
		clear_cache("writers")
示例#10
0
	def on_trash(self):
		NestedSet.on_trash(self)
		WebsiteGenerator.on_trash(self)
		self.delete_child_item_groups_key()
示例#11
0
	def on_trash(self):
		NestedSet.on_trash(self)
		WebsiteGenerator.on_trash(self)
示例#12
0
	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()
示例#13
0
	def after_rename(self, olddn, newdn, merge=False):
		NestedSet.after_rename(self, olddn, newdn, merge)
		WebsiteGenerator.after_rename(self, olddn, newdn, merge)
示例#14
0
 def on_update(self):
     WebsiteGenerator.on_update(self)
     NestedSet.on_update(self)
     clear_cache(website_group=self.name)
示例#15
0
def scrub(text):
    return WebsiteGenerator.scrub(None, text)
示例#16
0
 def on_update(self):
     WebsiteGenerator.on_update(self)
     clear_cache(website_group=self.name)