예제 #1
0
파일: web_page.py 프로젝트: fogueri/frappe
    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
파일: web_page.py 프로젝트: fogueri/frappe
    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)