15 lines
597 B
Python
15 lines
597 B
Python
|
|
from sqlalchemy import Column, Integer, String, ForeignKey, Numeric, Date
|
||
|
|
from sqlalchemy.orm import relationship
|
||
|
|
|
||
|
|
from models.entities.base import Base
|
||
|
|
|
||
|
|
class VendaJornalAvulso(Base):
|
||
|
|
__tablename__ = 'vendas_jornais_avulsos'
|
||
|
|
|
||
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||
|
|
militante_id = Column(Integer, ForeignKey('militantes.id'))
|
||
|
|
quantidade = Column(Integer, nullable=False)
|
||
|
|
valor_total = Column(Numeric(10, 2), nullable=False)
|
||
|
|
data_venda = Column(Date, nullable=False)
|
||
|
|
|
||
|
|
militante = relationship("Militante", back_populates="vendas_jornais_avulsos")
|