def get_defaults_for(parent=u'__default'):
 defaults = frappe.cache().hget(u'defaults', parent)
 if (defaults == None):
  res = frappe.db.sql(u'select defkey, defvalue from `tabDefaultValue`\n DCTB  DCTB  DCTB where parent = %s order by creation', (parent,), as_dict=1)
  defaults = frappe._dict({})
  for d in res:
   if (d.defkey in defaults):
    if ((not isinstance(defaults[d.defkey], list)) and (defaults[d.defkey] != d.defvalue)):
     defaults[d.defkey] = [defaults[d.defkey]]
    if (d.defvalue not in defaults[d.defkey]):
     defaults[d.defkey].append(d.defvalue)
   elif (d.defvalue is not None):
    defaults[d.defkey] = d.defvalue
  frappe.cache().hset(u'defaults', parent, defaults)
 return defaults

def get_defaults_for ( parent = u'__default' ) : defaults = frappe . cache ( ) . hget ( u'defaults' , parent ) if ( defaults == None ) : res = frappe . db . sql ( u'select defkey, defvalue from `tabDefaultValue`\n DCTB  DCTB  DCTB where parent = %s order by creation' , ( parent , ) , as_dict = 1 ) defaults = frappe . _dict ( { } ) for d in res : if ( d . defkey in defaults ) : if ( ( not isinstance ( defaults [ d . defkey ] , list ) ) and ( defaults [ d . defkey ] != d . defvalue ) ) : defaults [ d . defkey ] = [ defaults [ d . defkey ] ] if ( d . defvalue not in defaults [ d . defkey ] ) : defaults [ d . defkey ] . append ( d . defvalue ) elif ( d . defvalue is not None ) : defaults [ d . defkey ] = d . defvalue frappe . cache ( ) . hset ( u'defaults' , parent , defaults ) return defaults
get all defaults .