app.backbone.entities.timeframe
1from sqlalchemy import Boolean, Column, Integer, String 2from sqlalchemy.orm import relationship 3 4from . import Base 5 6# Clase que representa una tabla en la base de datos 7class Timeframe(Base): 8 __tablename__ = 'Timeframes' # Nombre de la tabla en la BD 9 10 Id = Column(Integer, primary_key=True, autoincrement=True) 11 Name = Column(String, nullable=False) 12 MetaTraderNumber = Column(Integer, nullable=False) 13 Selected = Column(Boolean, nullable=True) 14 15 Bot = relationship('Bot', back_populates='Timeframe', lazy='select') 16 17 18 def __repr__(self): 19 return f"<Timeframe(id={self.Id}, Name='{self.Name}', MetaTraderNumber={self.MetaTraderNumber})>" 20
class
Timeframe(sqlalchemy.orm.decl_api._DynamicAttributesType, sqlalchemy.inspection.Inspectable[sqlalchemy.orm.mapper.Mapper[typing.Any]]):
8class Timeframe(Base): 9 __tablename__ = 'Timeframes' # Nombre de la tabla en la BD 10 11 Id = Column(Integer, primary_key=True, autoincrement=True) 12 Name = Column(String, nullable=False) 13 MetaTraderNumber = Column(Integer, nullable=False) 14 Selected = Column(Boolean, nullable=True) 15 16 Bot = relationship('Bot', back_populates='Timeframe', lazy='select') 17 18 19 def __repr__(self): 20 return f"<Timeframe(id={self.Id}, Name='{self.Name}', MetaTraderNumber={self.MetaTraderNumber})>"
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.
Timeframe(**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.