feat: allow clearing web page views
This commit is contained in:
parent
3bbe4498a0
commit
83e3a20901
1 changed files with 7 additions and 1 deletions
|
|
@ -9,7 +9,13 @@ from frappe.model.document import Document
|
|||
|
||||
|
||||
class WebPageView(Document):
|
||||
pass
|
||||
@staticmethod
|
||||
def clear_old_logs(days=180):
|
||||
from frappe.query_builder import Interval
|
||||
from frappe.query_builder.functions import Now
|
||||
|
||||
table = frappe.qb.DocType("Web Page View")
|
||||
frappe.db.delete(table, filters=(table.modified < (Now() - Interval(days=days))))
|
||||
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue