Make the change before creating the form. But perhaps we should figure out how to make your computed field work instead.
On Friday, September 5, 2014 9:52:37 AM UTC-4, JorgeH wrote: > > Hello > > I've been trying to use a compute field that needs to use a class I > created . But I get the error : TypeError: unhashable type: 'list' > > Thus I intend to instead of a computed field, just do the calculations > before processing the form. > > if form1.process(session=None, formname='tabla1').accepted: > > The field I intend to calculate before inserting is 'consumo_mensual' > > my code so far is similar to this: > > form1 = SQLFORM(db.energia_termica) > > request.vars.consumo_mensual = ConvEtermica(request.vars.tipo > ,request.vars.consumo_teorico, request.vars.horas_uso_mes).consumo_mensual() > > form1.vars.consumo_mensual = request.vars.consumo_mensual > if form1.process(session=None, formname='tabla1').accepted: > > > > but it really is ignoring my tweak > > What is the correct way to doing it? > > Thanks > > > -- 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.

