def clear_default(key=None, value=None, parent=None, name=None, parenttype=None):
 conditions = []
 values = []
 if name:
  conditions.append(u'name=%s')
  values.append(name)
 else:
  if key:
   conditions.append(u'defkey=%s')
   values.append(key)
  if value:
   conditions.append(u'defvalue=%s')
   values.append(value)
  if parent:
   conditions.append(u'parent=%s')
   values.append(parent)
  if parenttype:
   conditions.append(u'parenttype=%s')
   values.append(parenttype)
 if parent:
  clear_cache(parent)
 else:
  clear_cache(u'__default')
  clear_cache(u'__global')
 if (not conditions):
  raise Exception, u'[clear_default] No key specified.'
 frappe.db.sql(u'delete from tabDefaultValue where {0}'.format(u' and '.join(conditions)), tuple(values))
 _clear_cache(parent)

def clear_default ( key = None , value = None , parent = None , name = None , parenttype = None ) : conditions = [ ] values = [ ] if name : conditions . append ( u'name=%s' ) values . append ( name ) else : if key : conditions . append ( u'defkey=%s' ) values . append ( key ) if value : conditions . append ( u'defvalue=%s' ) values . append ( value ) if parent : conditions . append ( u'parent=%s' ) values . append ( parent ) if parenttype : conditions . append ( u'parenttype=%s' ) values . append ( parenttype ) if parent : clear_cache ( parent ) else : clear_cache ( u'__default' ) clear_cache ( u'__global' ) if ( not conditions ) : raise Exception , u'[clear_default] No key specified.' frappe . db . sql ( u'delete from tabDefaultValue where {0}' . format ( u' and ' . join ( conditions ) ) , tuple ( values ) ) _clear_cache ( parent )
clear a default value by any of the given parameters and delete caches .