MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / BankAccount

Class BankAccount

test/ext/test_hybrid.py:2055–2068  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2053 Base = declarative_base()
2054
2055 class BankAccount(Base):
2056 __tablename__ = "bank_account"
2057 id = Column(Integer, primary_key=True)
2058
2059 _balance = Column("balance", Numeric)
2060
2061 @hybrid.hybrid_property
2062 def balance(self):
2063 """Return an Amount view of the current balance."""
2064 return Amount(self._balance, "usd")
2065
2066 @balance.setter
2067 def balance(self, value):
2068 self._balance = value.as_currency("usd").amount
2069
2070 cls.Amount = Amount
2071 cls.BankAccount = BankAccount

Callers 4

test_instance_oneMethod · 0.85
test_instance_twoMethod · 0.85
test_instance_threeMethod · 0.85
test_instance_fourMethod · 0.85

Calls 1

ColumnClass · 0.90

Tested by 4

test_instance_oneMethod · 0.68
test_instance_twoMethod · 0.68
test_instance_threeMethod · 0.68
test_instance_fourMethod · 0.68