Skip to content

Instantly share code, notes, and snippets.

@batok
Created November 11, 2010 17:26
Show Gist options
  • Save batok/672849 to your computer and use it in GitHub Desktop.
Save batok/672849 to your computer and use it in GitHub Desktop.
def preview(event):
prt = PrintTable()
regs = []
for anotacion in model.session.query( model.Anotacion ).filter( model.Anotacion.relacion == self.data).order_by( model.Anotacion.fecha_elaboracion.desc()):
regs.append([ anotacion.fecha_local, unicode( anotacion.anotacion )])
prt.data = regs
prt.left_margin = 0.5
prt.set_column = [2.0, 5.0]
prt.label = ["Fecha",u"Anotación"]
Tabla = getattr(model, anotacion.fuente)
reg = model.session.query( Tabla ).filter( Tabla.fecha_elaboracion == self.data).one()
campo = getattr(reg , "campo_base")
que = getattr(reg , campo)
prt.SetHeader("Anotaciones de {0}: {1}".format( anotacion.fuente, que ))
prt.SetFooter()
prt.SetFooter("Fecha : ", type = "Date", align=wx.ALIGN_RIGHT, indent = -1, colour = wx.NamedColour('RED'))
prt.SetPreviewSize( size = "Full")
prt.Preview()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment