You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2017/09/26 14:39:41 UTC
allura git commit: Cache Thread.last_post,
which avoids dupe queries when the prop is accessed frequently,
e.g. in allura/templates/widgets/threads_table.html
Repository: allura
Updated Branches:
refs/heads/master 587960209 -> 17d87298a
Cache Thread.last_post, which avoids dupe queries when the prop is accessed frequently, e.g. in allura/templates/widgets/threads_table.html
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/17d87298
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/17d87298
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/17d87298
Branch: refs/heads/master
Commit: 17d87298a7715995b995de55769b98c5e4d474cc
Parents: 5879602
Author: Dave Brondsema <da...@brondsema.net>
Authored: Fri Sep 22 17:48:29 2017 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Sep 22 17:48:29 2017 -0400
----------------------------------------------------------------------
Allura/allura/model/discuss.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/17d87298/Allura/allura/model/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index fd74c07..aff6607 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -369,7 +369,7 @@ class Thread(Artifact, ActivityObject):
self.num_replies = self.post_class().query.find(
dict(thread_id=self._id, status='ok', deleted=False)).count()
- @property
+ @LazyProperty
def last_post(self):
q = self.post_class().query.find(dict(
thread_id=self._id,