|
|
@@ -387,13 +387,23 @@ class Database(object): |
|
|
|
frappe.db.get_value("System Settings", None, "date_format") |
|
|
|
""" |
|
|
|
|
|
|
|
ret = self.get_values(doctype, filters, fieldname, ignore, as_dict, debug, |
|
|
|
result = self.get_values(doctype, filters, fieldname, ignore, as_dict, debug, |
|
|
|
order_by, cache=cache, for_update=for_update, run=run, pluck=pluck, distinct=distinct, limit=1) |
|
|
|
|
|
|
|
if not run: |
|
|
|
return ret |
|
|
|
return result |
|
|
|
|
|
|
|
if not result: |
|
|
|
return None |
|
|
|
|
|
|
|
row = result[0] |
|
|
|
|
|
|
|
if len(row) > 1 or as_dict: |
|
|
|
return row |
|
|
|
else: |
|
|
|
# single field is requested, send it without wrapping in containers |
|
|
|
return row[0] |
|
|
|
|
|
|
|
return ((len(ret[0]) > 1 or as_dict) and ret[0] or ret[0][0]) if ret else None |
|
|
|
|
|
|
|
def get_values(self, doctype, filters=None, fieldname="name", ignore=None, as_dict=False, |
|
|
|
debug=False, order_by="KEEP_DEFAULT_ORDERING", update=None, cache=False, for_update=False, |
|
|
|