Everything works fine, add, modify, etc. But when I ask Caja.Imp. He says
he does not exist.
# Table definition - Caja
#
Caja_table = sa.Table("Caja", metadata,
sa.Column('id', sa.Integer, nullable=True, autoincrement=True,
primary_key=True),
sa.Column('Entidad', sa.String, nullable=True),
sa.Column('Fecha', sa.Date, nullable=True),
sa.Column('Entrada', sa.Float, default=0, nullable=True),
sa.Column('Salida', sa.Float, default=0, nullable=True))
class Caja(object):
def __init__(self, Entidad, Fecha, Entrada, Salida):
self.Entidad = Entidad
self.Fecha = Fecha
self.Entrada = Entrada
self.Salida = Salida
@hybrid_property
* def imp(self):*
return float(self.Entrada - self.Salida)
def __repr__(self):
return "<Caja('%s', Cond. %s Ent:%s Fch:%s Grup:%s', Ent: %i' Sal:
%i Imp:%.2f)>" % (self.id, self.id_Conceptos, self.Entidad, self.Fecha,
self.Grupo, self.Entrada, self.Salida, self.imp)
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.