소스 검색

fix(db): Import cast as cast_fieldtype to manevour ambiguity

version-14
Gavin D'souza 3 년 전
부모
커밋
57bd1b6031
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. +4
    -3
      frappe/database/database.py

+ 4
- 3
frappe/database/database.py 파일 보기

@@ -22,7 +22,8 @@ from frappe.exceptions import DoesNotExistError
from frappe.model.utils.link_count import flush_local_link_count
from frappe.query_builder.functions import Count
from frappe.query_builder.utils import DocType
from frappe.utils import cast, get_datetime, get_table_name, getdate, now, sbool
from frappe.utils import cast as cast_fieldtype
from frappe.utils import get_datetime, get_table_name, getdate, now, sbool

IFNULL_PATTERN = re.compile(r"ifnull\(", flags=re.IGNORECASE)
INDEX_PATTERN = re.compile(r"\s*\([^)]+\)\s*")
@@ -651,7 +652,7 @@ class Database(object):

for fieldname, value in queried_result:
if df := meta.get_field(fieldname):
casted_value = cast(df.fieldtype, value)
casted_value = cast_fieldtype(df.fieldtype, value)
else:
casted_value = value
return_value[fieldname] = casted_value
@@ -719,7 +720,7 @@ class Database(object):
_("Invalid field name: {0}").format(frappe.bold(fieldname)), self.InvalidColumnName
)

val = cast(df.fieldtype, val)
val = cast_fieldtype(df.fieldtype, val)

self.value_cache[doctype][fieldname] = val



불러오는 중...
취소
저장