Beispiel #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))
Beispiel #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))
Beispiel #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))
Beispiel #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)
Beispiel #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))
Beispiel #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))
Beispiel #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))
Beispiel #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))
Beispiel #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))