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))
def currency_or_default_or_fail_converter(value): return (d_quant_currency(value) if value is not None else d_quant_currency(default))
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))
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)
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))
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))
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))
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))
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))