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