app.backbone.entities.luck_test
1from sqlalchemy import Column, ForeignKey, Integer, Float, String, Date 2from sqlalchemy.orm import relationship 3 4from . import Base 5 6class LuckTest(Base): 7 __tablename__ = 'LuckTests' 8 9 Id = Column(Integer, primary_key=True, autoincrement=True) 10 BotPerformanceId = Column(Integer, ForeignKey('BotPerformances.Id'), nullable=False) 11 LuckTestPerformanceId = Column(Integer, ForeignKey('BotPerformances.Id'), nullable=False) 12 TradesPercentToRemove = Column(Float, nullable=False) 13 14 # Relación con BotPerformance original 15 BotPerformance = relationship( 16 'BotPerformance', 17 foreign_keys=[BotPerformanceId], 18 back_populates='LuckTest', 19 lazy='joined', 20 uselist=False 21 ) 22 23 # Relación con LuckTestPerformance (otro registro en la misma tabla) 24 LuckTestPerformance = relationship( 25 'BotPerformance', 26 foreign_keys=[LuckTestPerformanceId], 27 lazy='joined', 28 uselist=False 29 ) 30 31 def __repr__(self): 32 return (f"<LuckTest(id={self.Id}, " 33 f"BotPerformanceId='{self.BotPerformanceId}', " 34 f"LuckTestPerformanceId='{self.LuckTestPerformanceId}', " 35 f"TradesPercentToRemove={self.TradesPercentToRemove})>")
class
LuckTest(sqlalchemy.orm.decl_api._DynamicAttributesType, sqlalchemy.inspection.Inspectable[sqlalchemy.orm.mapper.Mapper[typing.Any]]):
7class LuckTest(Base): 8 __tablename__ = 'LuckTests' 9 10 Id = Column(Integer, primary_key=True, autoincrement=True) 11 BotPerformanceId = Column(Integer, ForeignKey('BotPerformances.Id'), nullable=False) 12 LuckTestPerformanceId = Column(Integer, ForeignKey('BotPerformances.Id'), nullable=False) 13 TradesPercentToRemove = Column(Float, nullable=False) 14 15 # Relación con BotPerformance original 16 BotPerformance = relationship( 17 'BotPerformance', 18 foreign_keys=[BotPerformanceId], 19 back_populates='LuckTest', 20 lazy='joined', 21 uselist=False 22 ) 23 24 # Relación con LuckTestPerformance (otro registro en la misma tabla) 25 LuckTestPerformance = relationship( 26 'BotPerformance', 27 foreign_keys=[LuckTestPerformanceId], 28 lazy='joined', 29 uselist=False 30 ) 31 32 def __repr__(self): 33 return (f"<LuckTest(id={self.Id}, " 34 f"BotPerformanceId='{self.BotPerformanceId}', " 35 f"LuckTestPerformanceId='{self.LuckTestPerformanceId}', " 36 f"TradesPercentToRemove={self.TradesPercentToRemove})>")
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.
LuckTest(**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.