瀏覽代碼

Merge pull request #16476 from resilient-tech/better-repr

version-14
Suraj Shetty 3 年之前
committed by GitHub
父節點
當前提交
beb84ffb2d
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 2 行新增4 行删除
  1. +2
    -4
      frappe/model/document.py

+ 2
- 4
frappe/model/document.py 查看文件

@@ -1378,11 +1378,9 @@ class Document(BaseDocument):
doctype = self.__class__.__name__

docstatus = f" docstatus={self.docstatus}" if self.docstatus else ""
repr_str = f"<{doctype}: {name}{docstatus}"
parent = f" parent={self.parent}" if getattr(self, "parent", None) else ""

if not hasattr(self, "parent"):
return repr_str + ">"
return f"{repr_str} parent={self.parent}>"
return f"<{doctype}: {name}{docstatus}{parent}>"

def __str__(self):
name = self.name or "unsaved"


Loading…
取消
儲存