Changeset 4675


Ignore:
Timestamp:
17/12/08 17:17:38 (11 years ago)
Author:
cbyrom
Message:

Extend renderer to use htmlfill to allow a dict of form values to be
specified to allow forms to get pre-populated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/lib/atomutilities.py

    r4478 r4675  
    44import logging 
    55from milk_server.lib.base import * 
     6from formencode import htmlfill 
    67 
    7 def savePageAndRender(pathInfo, template): 
     8def savePageAndRender(pathInfo, template, **inputs): 
    89    logging.debug("Saving current page url (%s) - to keep track of atom editor state" %pathInfo) 
    910    session['currentEditor'] = pathInfo 
    1011    session.save() 
    1112    logging.debug("Now rendering current template (%s)" %template) 
    12     return render("genshi", template)  
    13      
    14      
     13    html = render("genshi", template) 
     14    for key, val in inputs.items(): 
     15        inputs[key] = str(val) 
     16 
     17    return htmlfill.render(html, inputs) 
Note: See TracChangeset for help on using the changeset viewer.