Exemplo n.º 1
0
def DefaultCurrencyCell(locator=None, default=Decimal("0"), label=None):
    """Return a cell that converts to a Decimal, quantized for currency, or default."""
    def currency_or_null_data_type(cell):
        return cell.data_type in frozenset([DataType.NUMERIC, DataType.NULL])

    def currency_or_default_or_fail_converter(value):
        return (d_quant_currency(value)
                if value is not None else d_quant_currency(default))

    return SchemaCell(locator,
                      currency_or_null_data_type,
                      currency_or_default_or_fail_converter,
                      label=None)

    return SchemaCell(locator, DataType.NUMERIC, lambda v: d_quant_currency(v))
Exemplo n.º 2
0
 def currency_or_default_or_fail_converter(value):
     return (d_quant_currency(value)
             if value is not None else d_quant_currency(default))
Exemplo n.º 3
0
 def target_cost_per_exe(self):
     """Return the estimated cost to obtain a lease execution in this period."""
     return d_quant_currency(
         d_div_or_none(self.target_acq_investment,
                       self.target_leases_executed))
Exemplo n.º 4
0
def CurrencyCell(locator=None, label=None):
    """Return a cell that converts to a Decimal, quantized for currency."""
    return SchemaCell(locator,
                      DataType.NUMERIC,
                      lambda v: d_quant_currency(v),
                      label=None)
Exemplo n.º 5
0
 def target_cost_per_app(self):
     """Return the estimated cost to obtain a lease application in this period."""
     return d_quant_currency(
         d_div_or_none(self.target_acq_investment,
                       self.target_lease_applications))
Exemplo n.º 6
0
 def target_cost_per_tou(self):
     """Return the estimated cost to obtain an inbound tour in this period."""
     return d_quant_currency(
         d_div_or_none(self.target_acq_investment, self.target_tours))
Exemplo n.º 7
0
 def target_cost_per_usv(self):
     """Return the target cost to obtain a unique site visitor in this period."""
     return d_quant_currency(
         d_div_or_none(self.target_acq_investment, self.target_usvs))
Exemplo n.º 8
0
 def cost_per_inq(self):
     """Return the estimated cost to obtain an inbound inquiry in this period."""
     return d_quant_currency(
         d_div_or_0(self.acq_investment_without_leasing, self.inquiries))
Exemplo n.º 9
0
 def cost_per_usv(self):
     """Return the estimated cost to obtain a unique site visitor in this period."""
     return d_quant_currency(
         d_div_or_0(self.acq_investment_without_leasing, self.usvs))