allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kentontay...@apache.org
Subject 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
Date Tue, 26 Sep 2017 14:39:41 GMT
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 <dave@brondsema.net>
Authored: Fri Sep 22 17:48:29 2017 -0400
Committer: Dave Brondsema <dave@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,


Mime
View raw message