瀏覽代碼

[minor] [enhancement] added frappe.get_precision

version-14
Rushabh Mehta 10 年之前
父節點
當前提交
b82da2a897
共有 1 個檔案被更改,包括 5 行新增0 行删除
  1. +5
    -0
      frappe/__init__.py

+ 5
- 0
frappe/__init__.py 查看文件

@@ -424,6 +424,11 @@ def is_table(doctype):
cache().set_value("is_table", tables) cache().set_value("is_table", tables)
return doctype in tables return doctype in tables


def get_precision(doctype, fieldname, currency=None, doc=None):
"""Get precision for a given field"""
from frappe.model.meta import get_field_precision
return get_field_precision(get_meta(doctype).get_field(fieldname), doc, currency)

def generate_hash(txt=None): def generate_hash(txt=None):
"""Generates random hash for given text + current timestamp + random string.""" """Generates random hash for given text + current timestamp + random string."""
import hashlib, time import hashlib, time


Loading…
取消
儲存