On 11/07/11 14:18, Venkatraman S wrote:
On Mon, Jul 11, 2011 at 7:07 AM, Michael Ludvig <mlud...@patmat.co.nz <mailto:mlud...@patmat.co.nz>> wrote:

    Now I need to not only save the entered values to the db (that
    works well) but I also need to send a copy of the submitted form
    to an email address.

    I wonder if there is an easy way for rendering the form into a
    static html email. Essentially I want to replace all the <input>
    and <textarea> widgets with their value and then print it as {{
    form.as_submitted }} kind of.

    As the form is quite long I don't want to maintain a
    field-after-field html template for the results.

    Is there any convenient way to do this?


Iterate over the fields in the form in an email template and send that template over?

Hmm, yes, that'll do. I was hoping for getting away without the iteration.

Btw, i guess you are using uni-form - its perfect for large forms, as you have to only specify the layout as a layout and the rendering is taken care of by it.

Nope, I use div-based form with some hacks to create sections. I didn't know about uni-form until now, thanks for pointing it out. Just had a quick read about it and it looks nice!

*Michal
*/PatMat Ltd./
✉ mlud...@patmat.co.nz <mailto:mlud...@patmat.co.nz>

PatMat Property Solutions - We Buy Houses in Auckland <http://patmat.co.nz>/*PatMat Property Solutions

*/http://patmat.co.nz - We Buy Houses in Auckland!

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

<<image/png>>

Reply via email to