def s3_currency(name='currency', **attr):
 settings = current.deployment_settings
 if ('label' not in attr):
  attr['label'] = current.T('Currency')
 if ('default' not in attr):
  attr['default'] = settings.get_fin_currency_default()
 if ('requires' not in attr):
  currency_opts = settings.get_fin_currencies()
  attr['requires'] = IS_IN_SET(currency_opts.keys(), zero=None)
 if ('writable' not in attr):
  attr['writable'] = settings.get_fin_currency_writable()
 f = S3ReusableField(name, length=3, **attr)
 return f()

def s3_currency ( name = 'currency' , ** attr ) : settings = current . deployment_settings if ( 'label' not in attr ) : attr [ 'label' ] = current . T ( 'Currency' ) if ( 'default' not in attr ) : attr [ 'default' ] = settings . get_fin_currency_default ( ) if ( 'requires' not in attr ) : currency_opts = settings . get_fin_currencies ( ) attr [ 'requires' ] = IS_IN_SET ( currency_opts . keys ( ) , zero = None ) if ( 'writable' not in attr ) : attr [ 'writable' ] = settings . get_fin_currency_writable ( ) f = S3ReusableField ( name , length = 3 , ** attr ) return f ( )
return a standard currency field @todo: move to a finance module? .