allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [02/38] git commit: [#4019] ticket:481 Prevent unnecessary calls to solr for filter choices
Date Wed, 30 Apr 2014 18:15:34 GMT
[#4019] ticket:481 Prevent unnecessary calls to solr for filter choices


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/bab54f1f
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/bab54f1f
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/bab54f1f

Branch: refs/heads/master
Commit: bab54f1fa1e691f57a880e71e460ecd0774ffd04
Parents: c1bc04b
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Mon Dec 16 16:16:16 2013 +0200
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Apr 30 15:55:08 2014 +0000

----------------------------------------------------------------------
 ForgeTracker/forgetracker/tracker_main.py          |  7 +++----
 ForgeTracker/forgetracker/widgets/ticket_search.py | 12 ++++++------
 2 files changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/bab54f1f/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 356702d..87a72c0 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -169,7 +169,6 @@ class W:
     markdown_editor = ffw.MarkdownEdit()
     label_edit = ffw.LabelEdit()
     attachment_list = ffw.AttachmentList()
-    ticket_search_results = TicketSearchResults()
     mass_edit = MassEdit()
     mass_edit_form = MassEditForm()
     bin_form = BinForm()
@@ -666,7 +665,7 @@ class RootController(BaseController, FeedController):
             solr_col = _mongo_col_to_solr_col(sort_split[0])
             result['url_sort'] = '%s %s' % (solr_col, sort_split[1])
         c.subscribe_form = W.subscribe_form
-        c.ticket_search_results = W.ticket_search_results
+        c.ticket_search_results = TicketSearchResults()
         return result
 
     @without_trailing_slash
@@ -768,7 +767,7 @@ class RootController(BaseController, FeedController):
         result['help_msg'] = c.app.config.options.get(
             'TicketHelpSearch', '').strip()
         result['deleted'] = deleted
-        c.ticket_search_results = W.ticket_search_results
+        c.ticket_search_results = TicketSearchResults()
         return result
 
     @with_trailing_slash
@@ -1844,6 +1843,6 @@ class MilestoneController(BaseController):
             sort_split = sort.split(' ')
             solr_col = _mongo_col_to_solr_col(sort_split[0])
             result['url_sort'] = '%s %s' % (solr_col, sort_split[1])
-        c.ticket_search_results = W.ticket_search_results
+        c.ticket_search_results = TicketSearchResults()
         c.auto_resize_textarea = W.auto_resize_textarea
         return result

http://git-wip-us.apache.org/repos/asf/allura/blob/bab54f1f/ForgeTracker/forgetracker/widgets/ticket_search.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/ticket_search.py b/ForgeTracker/forgetracker/widgets/ticket_search.py
index 5c9c787..65d90c4 100644
--- a/ForgeTracker/forgetracker/widgets/ticket_search.py
+++ b/ForgeTracker/forgetracker/widgets/ticket_search.py
@@ -43,12 +43,12 @@ class TicketSearchResults(ew_core.SimpleForm):
         page_size = ffw.PageSize()
         lightbox = ffw.Lightbox(name='col_list', trigger='#col_menu')
 
-    @property
-    def filters(self):
-        return {name: [{'value': val,
-                        'label': '%s (%s)' % (val, count),
-                        'selected': False} for val, count in field]
-                for name, field in choices_for_filter().iteritems()}
+    def __init__(self, *args, **kw):
+        super(TicketSearchResults, self).__init__(*args, **kw)
+        self.filters = {name: [{'value': val,
+                            'label': '%s (%s)' % (val, count),
+                            'selected': False} for val, count in field]
+                        for name, field in choices_for_filter().iteritems()}
 
     def resources(self):
         yield ew.JSLink('tracker_js/jquery.multiselect.min.js')


Mime
View raw message