El 13/08/14 a las #4, Leonel Câmara escribió:
> Simply adding to current.response.files may not works if the request
> is ajax (say your module is loaded).
But it's not loaded via ajax, I call it like this:
> @requires_get_arguments(('grupo', db.grupo),
> ('productor', db.productor),
> _consistency= (
> ((db.grupo.id==db.grupoXred.grupo) &
>
> (db.productor.grupo==db.grupoXred.red)),
>
> (db.productor.grupo==db.grupo.id) )
> )
> @auth.requires_membership('admins_%s'%request.vars.grupo)
> def grafica_grupo_productor():
> '''Muestra tabla y grafica de productos x fecha_pedido para un
> productor fijo,
> con la cantidad total que se pide de cada producto en cada fecha
> '''
>
> iproductor = int(request.vars.productor)
> productor = db.productor[iproductor]
> igrupo = int(request.vars.grupo)
> grupo = db.grupo(igrupo)
>
> response.title = T('Estadísticas del grupo %s con
> %s')%(grupo.nombre, productor.nombre)
>
> def row_represent(pid):
> return db.producto[pid].nombre
> args = ((db.item.productoXpedido==db.productoXpedido.id) &
> (db.productoXpedido.pedido==db.pedido.id) &
> (db.pedido.productor==iproductor) &
> (db.item.grupo==igrupo),
> db.productoXpedido.producto,
> db.pedido.fecha_reparto,
> db.item.cantidad.sum())
> sheet = ROSheet(*args,
> row_represent=row_represent,
> col_totals=True)
> jqplot = JQPlot(*args,
> row_represent=row_represent,
> col_represent=str)
> return dict(sheet=sheet, jqplot=jqplot,
> nombre_productor=productor.nombre,
> grupo=grupo)
and the view is:
> {{extend 'layout.html'}}
> ... etc ...
> {{=jqplot}}
> {{=sheet}}
> ... etc ...
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.