joining table allocation to actifs
This commit is contained in:
@@ -36,25 +36,21 @@ class Actifs(Base):
|
||||
modif_le = Column(DateTime, default=datetime.datetime.utcnow)
|
||||
__table_args__ = (Index('symbole_index', 'symbole'),)
|
||||
|
||||
|
||||
class Allocation(Base):
|
||||
__tablename__ = 'allocation'
|
||||
no_cat = Column(Integer, primary_key=True)
|
||||
classe_id = Column(Unicode(45), ForeignKey('classes.classe'))
|
||||
classe = Column(Unicode(45), ForeignKey('actifs.classe'))
|
||||
pc_cible = Column(Integer)
|
||||
pc_atteint = Column(Float)
|
||||
pc_ecart = Column(Float)
|
||||
valeur = Column(Float)
|
||||
|
||||
# relationship
|
||||
classe = relationship('Classes', backref="allocation")
|
||||
|
||||
class Classes(Base):
|
||||
__tablename__ = 'classes'
|
||||
classe = Column(Unicode(45), primary_key=True)
|
||||
type = Column(Unicode(45), default='ACTION')
|
||||
ordre = Column(Integer)
|
||||
bg_color = Column(Unicode(45))
|
||||
__table_args__ = (Index('ordre_index', 'ordre'),)
|
||||
|
||||
__table_args__ = (Index('classe_index', 'classe'), Index('ordre_index', 'ordre'),)
|
||||
|
||||
|
||||
class Histo(Base):
|
||||
__tablename__ = 'histo'
|
||||
no_id = Column(Integer, primary_key=True)
|
||||
|
||||
Reference in New Issue
Block a user