app.backbone.entities.metric_wharehouse

 1from sqlalchemy import Column, ForeignKey, Float, Integer, String
 2from sqlalchemy.orm import relationship
 3
 4from . import Base
 5
 6# Clase que representa una tabla en la base de datos
 7class MetricWharehouse(Base):
 8    __tablename__ = 'MetricsWarehouse'
 9
10    Id = Column(Integer, primary_key=True, autoincrement=True)
11    MontecarloTestId = Column(Integer, ForeignKey('MontecarloTests.Id'), nullable=False)  # Relación con MontecarloTest
12
13    Method = Column(String, nullable=False)
14    Metric = Column(String, nullable=False)
15    ColumnName = Column(String, nullable=False)
16    Value = Column(Float, nullable=False)
17
18    # Relación con MontecarloTest
19    MontecarloTest = relationship('MontecarloTest', back_populates='Metrics', lazy='joined')
20
21    def __repr__(self):
22        return f"<MetricWharehouse(id={self.Id}, Method='{self.Method}', Metric={self.Metric}, Value={self.Value})>"
class MetricWharehouse(sqlalchemy.orm.decl_api._DynamicAttributesType, sqlalchemy.inspection.Inspectable[sqlalchemy.orm.mapper.Mapper[typing.Any]]):
 8class MetricWharehouse(Base):
 9    __tablename__ = 'MetricsWarehouse'
10
11    Id = Column(Integer, primary_key=True, autoincrement=True)
12    MontecarloTestId = Column(Integer, ForeignKey('MontecarloTests.Id'), nullable=False)  # Relación con MontecarloTest
13
14    Method = Column(String, nullable=False)
15    Metric = Column(String, nullable=False)
16    ColumnName = Column(String, nullable=False)
17    Value = Column(Float, nullable=False)
18
19    # Relación con MontecarloTest
20    MontecarloTest = relationship('MontecarloTest', back_populates='Metrics', lazy='joined')
21
22    def __repr__(self):
23        return f"<MetricWharehouse(id={self.Id}, Method='{self.Method}', Metric={self.Metric}, Value={self.Value})>"

The base class of the class hierarchy.

When called, it accepts no arguments and returns a new featureless instance that has no instance attributes and cannot be given any.

MetricWharehouse(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships.

Id
MontecarloTestId
Method
Metric
ColumnName
Value
MontecarloTest