First, you don't use form.process() with crud forms -- crud handles the 
processing itself. Also, I believe that "read" forms do not have anything 
in form.vars, so you'll have to get those values directly from the 
submitted record.

Anthony

On Thursday, November 10, 2011 3:18:14 PM UTC-5, lucas wrote:
>
> hello everyone, 
>
> trying to understand why the pmsg below fails to pull the values of 
> the form ef.  all i get is None for each of the three, 
> ef.vars.email_address, ef.vars.subject, and ef.vars.message_body.  all 
> three are spelled correctly and the full form ef, displays all of the 
> proper information once the view is rendered. 
>
> def c_email(): 
>     msg = "" 
>     pmsg = "" 
>     response.subtitle = "Email Us" 
>     ef = crud.create(db.email, onaccept=lambda ef: ef.vars.id) 
>     if ef.process().accepted: 
>         if ef.vars.id: 
>             msg = ef.vars.id 
>             ef = crud.read(db.email, msg)    #ef changes here 
>             msg = str(msg)+" Your message was accepted and sent. Thank 
> you for your interest in IQa." 
>             pmsg = P("reply_to: ", ef.vars.email_address, ", subject: 
> ", ef.vars.subject, ", message: ", ef.vars.message_body) 
>     return dict(message=msg, email_form=ef, post_message=pmsg)

Reply via email to