i found the solution<br>

<div>This is my first attempt at memcaching html page using cheetah </div>

<div>since cheetah render needs locals() i use getCallerInfo() to get the locals() and send to memcached</div>

<div>let me know if it is possible to better do this</div>


<div><b>notice getCallerInfo<br></b></div>

<div><br></div>

<div><b>utils.py</b></div>

<div>@log_time_func</div>

<div>def renderpage(key, htmlfile, deleteafter=3600):</div>

<div>    from globaldb import mc</div>

<div>    try:page = mc.get(key)</div>


<div>    except:</div>

<div>        page=None</div>

<div>        <a href="http://clogger.info/" target="_blank">clogger.info</a>('except error mc.get '+ key)</div>

<div>    if not page:</div>

<div>        <a href="http://clogger.info/" target="_blank">clogger.info</a>(key+ ' rendering cheetah page')</div>


<div>        terms = getCallerInfo(1)</div>

<div>        #print terms</div>

<div>        page = str(web.render(htmlfile, asTemplate=True, terms=terms))</div>

<div>        try:mc.set(key, page, deleteafter)</div>

<div>        except:</div>


<div>            <a href="http://clogger.info/" target="_blank">clogger.info</a>('except error mc.set '+ key)</div>

<div>    return page</div>

<div><br></div>

<div>@log_time_func</div>

<div>@memcachethis</div>

<div>def mcrenderpage(key, htmlfile, deleteafter=3600):</div>


<div>    terms = getCallerInfo(2)</div>

<div>    #print terms</div>

<div>    return str(web.render(htmlfile, asTemplate=True, terms=terms))</div>

<div><br></div>

<div>def getCallerInfo(decorators=0):</div>

<div>    '''returns locals of caller using frame.optional pass number of decorators\nFrom Dig deep into python internals <a href="http://www.devx.com/opensource/Article/31593/1954%27" target="_blank">http://www.devx.com/opensource/Article/31593/1954'</a>''</div>



<div>    f = sys._getframe(2+decorators)</div>

<div>    args = inspect.getargvalues(f)</div>

<div>    return args[3]</div>

<div><br></div>

<div><b>Usage</b></div>

<div>        key=facebookstuff.APP_NAME+'newstart'+str(uid)</div>


<div>        return utils.renderpage(key, 'pick.html')</div>

<br>
<br clear="all">
<br>
-- <br>
Bidegg worlds best auction site<br>
<a href="http://bidegg.com">http://bidegg.com</a>