feat: Add currency and unit support across models, routes, and templates; enhance UI for consumption, costs, and production
This commit is contained in:
@@ -10,9 +10,14 @@ class ProductionOutput(Base):
|
||||
scenario_id = Column(Integer, ForeignKey("scenario.id"), nullable=False)
|
||||
amount = Column(Float, nullable=False)
|
||||
description = Column(String, nullable=True)
|
||||
unit_name = Column(String(64), nullable=True)
|
||||
unit_symbol = Column(String(16), nullable=True)
|
||||
|
||||
scenario = relationship(
|
||||
"Scenario", back_populates="production_output_items")
|
||||
|
||||
def __repr__(self):
|
||||
return f"<ProductionOutput id={self.id} scenario_id={self.scenario_id} amount={self.amount}>"
|
||||
return (
|
||||
f"<ProductionOutput id={self.id} scenario_id={self.scenario_id} "
|
||||
f"amount={self.amount} unit={self.unit_symbol or self.unit_name}>"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user