bugfixes for caching patch

This commit is contained in:
KeyserSosa
2009-07-06 15:37:48 -07:00
parent b2b20380dc
commit 2837bb3c45
10 changed files with 15 additions and 12 deletions

View File

@@ -70,6 +70,8 @@ class ButtonsController(RedditController):
import traceback
g.log.debug("FULLPATH: get_link error in buttons code")
g.log.debug(traceback.format_exc())
if wrapper:
return wrapper(None)
@validate(url = VSanitizedUrl('url'),

View File

@@ -20,7 +20,7 @@
# CondeNet, Inc. All Rights Reserved.
################################################################################
from utils import to36, tup, iters
from wrapped import Wrapped, StringTemplate, CacheStub, CachedVariable
from wrapped import Wrapped, StringTemplate, CacheStub, CachedVariable, Templated
from mako.template import Template
from r2.lib.filters import spaceCompress, safemarkdown
import time, pytz
@@ -90,7 +90,8 @@ class UserItemJsonTemplate(TableRowTemplate):
def cells(self, thing):
cells = []
for cell in thing.cells:
r = Templated.part_render(thing, 'cell_type', cell)
thing.name = cell
r = thing.part_render('cell_type', style = "html")
cells.append(spaceCompress(r))
return cells

View File

@@ -242,7 +242,7 @@ class Subreddit(Thing, Printable):
@classmethod
def add_props(cls, user, wrapped):
names = ('subscriber', 'moderator', 'contributor')
rels = (SRMember._fast_query(wrapped, [user], names) if user else {})
rels = (SRMember._fast_query(wrapped, [user], names) if c.user_is_loggedin else {})
defaults = Subreddit.default_subreddits()
for item in wrapped:
if not user or not user.has_subscribed:

View File

@@ -30,7 +30,7 @@
<%def name="parent()">
%if c.profilepage:
<small>
<a href="${thing.ancestor.url}">${thing.ancestor.titleprefix}${thing.ancestor.title}</a></small><br \>
<a href="${thing.link.url}">${thing.link.title}</a></small><br \>
%endif
</%def>

View File

@@ -29,7 +29,7 @@
<%def name="parent()">
%if c.profilepage:
<small>
<a href="${thing.ancestor.url}">${thing.ancestor.titleprefix}${thing.ancestor.title}</a></small><br \>
<a href="${thing.link.url}">${thing.link.title}</a></small><br \>
%endif
</%def>

View File

@@ -27,7 +27,7 @@
<%inherit file="printable.htmllite" />
<%def name="entry()">
<tr><td valign="top" rowspan="2" class="number">$num</td>
<tr><td valign="top" rowspan="2" class="number">${thing.num}</td>
<td>
<a target="reddit_pop" href="${thing.url}" class="title">${thing.title}</a>
<span class="small">&nbsp;(${thing.domain})</span>

View File

@@ -24,7 +24,7 @@
<table>
%for a in thing.things:
${unsafe(replace_render(thing, a))}
${a}
%endfor:
</table>

View File

@@ -25,7 +25,7 @@
${thing.classname and ("classname=%s" % str(thing.classname))}>\
%endif
%for t in thing.stack:
${t.render()}
${t}
%endfor
%if div:
</div>

View File

@@ -22,4 +22,4 @@
<%inherit file="base.wired"/>
${thing.content().render()}
${thing.content()}

View File

@@ -31,8 +31,8 @@
%endfor
</tr>
<%def name="cell_type(name)">
%if name == "user":
<%def name="cell_type()">
%if thing.name == "user":
<span class="user">
${plain_link(thing.user.name, "/user/%s/" % thing.user.name,
_sr_path=False)}
@@ -43,7 +43,7 @@
${plain_link(_("send message"),
"/message/compose?to=%s" % (thing.user.name))}
&nbsp;
%elif name == "remove" and thing.editable:
%elif thing.name == "remove" and thing.editable:
${ynbutton(_("remove"), "removed", "unfriend",
callback="deleteRow",
hidden_data = dict(type = thing.type,