app.backbone.entities.config
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 Config(Base): 7 __tablename__ = 'Configs' # Nombre de la tabla en la BD 8 9 Id = Column(Integer, primary_key=True, autoincrement=True) 10 Name = Column(String, nullable=False) 11 Value = Column(String, nullable=False) 12 13 14 def __repr__(self): 15 return f"<Config(id={self.Id}, name='{self.Name}', Value={self.Value})>"
class
Config(sqlalchemy.orm.decl_api._DynamicAttributesType, sqlalchemy.inspection.Inspectable[sqlalchemy.orm.mapper.Mapper[typing.Any]]):
7class Config(Base): 8 __tablename__ = 'Configs' # Nombre de la tabla en la BD 9 10 Id = Column(Integer, primary_key=True, autoincrement=True) 11 Name = Column(String, nullable=False) 12 Value = Column(String, nullable=False) 13 14 15 def __repr__(self): 16 return f"<Config(id={self.Id}, name='{self.Name}', 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.
Config(**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.