-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into multiple-webform-for-same-doctype
- Loading branch information
Showing
5 changed files
with
16 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
# Copyright (c) 2018, Frappe Technologies and contributors | ||
# License: MIT. See LICENSE | ||
|
||
import frappe | ||
from frappe.model.document import Document | ||
|
||
|
||
class ViewLog(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("View Log") | ||
frappe.db.delete(table, filters=(table.modified < (Now() - Interval(days=days)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters