def dvr_case_default_status():
 s3db = current.s3db
 ctable = s3db.dvr_case
 field = ctable.status_id
 default = field.default
 if default:
  return default
 stable = s3db.dvr_case_status
 query = ((stable.is_default == True) & (stable.deleted != True))
 row = current.db(query).select(stable.id, limitby=(0, 1)).first()
 if row:
  ctable = s3db.dvr_case
  default = field.default = row.id
 return default

def dvr_case_default_status ( ) : s3db = current . s3db ctable = s3db . dvr_case field = ctable . status_id default = field . default if default : return default stable = s3db . dvr_case_status query = ( ( stable . is_default == True ) & ( stable . deleted != True ) ) row = current . db ( query ) . select ( stable . id , limitby = ( 0 , 1 ) ) . first ( ) if row : ctable = s3db . dvr_case default = field . default = row . id return default
helper to get/set the default status for case records @return: the default status_id .