'Returns a document property or list of properties.
:param doctype: DocType name.
:param filters: Filters like `{"x":"y"}` or name of the document. `None` if Single DocType.
:param fieldname: Column name.
:param ignore: Don\'t raise exception if table, column is missing.
:param as_dict: Return values as dict.
:param debug: Print query in error log.
:param order_by: Column to order by
Example:
# return first customer starting with a
frappe.db.get_value("Customer", {"name": ("like a%")})
# return last login of **User** `test@example.com`
frappe.db.get_value("User", "test@example.com", "last_login")
last_login, last_ip = frappe.db.get_value("User", "test@example.com",
["last_login", "last_ip"])
# returns default date_format
frappe.db.get_value("System Settings", None, "date_format")'

def get_value(self, doctype, filters=None, fieldname=u'name', ignore=None, as_dict=False, debug=False, order_by=None, cache=False):

    ret = self.get_values(doctype, filters, fieldname, ignore, as_dict, debug, order_by, cache=cache)
    return (((((len(ret[0]) > 1) or as_dict) and ret[0]) or ret[0][0]) if ret else None)
