Temporary fix for Issue 636 by turning off the caching of the page's entities.
authorLennard de Rijk <ljvderijk@gmail.com>
Mon, 08 Jun 2009 22:28:17 +0200
changeset 2410 cb136ce6c8d1
parent 2409 5ffa2372f1d6
child 2411 19e9fdde919e
Temporary fix for Issue 636 by turning off the caching of the page's entities. This also means that pagination is turned back on because querying all 1000 projects every time will take too long.
app/soc/views/models/program.py
--- a/app/soc/views/models/program.py	Mon Jun 08 21:57:12 2009 +0200
+++ b/app/soc/views/models/program.py	Mon Jun 08 22:28:17 2009 +0200
@@ -283,7 +283,7 @@
   @decorators.merge_params
   @decorators.check_access
   def acceptedProjects(self, request, access_type,
-		       page_name=None, params=None, filter=None, **kwargs):
+                       page_name=None, params=None, filter=None, **kwargs):
     """See base.View.list.
     """
     contents = []
@@ -292,8 +292,8 @@
     program_entity = logic.getFromKeyFieldsOr404(kwargs)
 
     filter = {
-	'status': 'accepted',
-	'program': program_entity }
+        'status': 'accepted',
+        'program': program_entity}
 
     fmt = {'name': program_entity.name}
     description = self.DEF_ACCEPTED_PROJECTS_MSG_FMT % fmt
@@ -301,24 +301,13 @@
     from soc.views.models import student_project as sp_view
 
     ap_params = sp_view.view.getParams().copy() # accepted projects
+    ap_params['list_action'] = (redirects.getPublicRedirect, ap_params)
+    ap_params['list_description'] = description
+    ap_params['list_heading'] = 'soc/student_project/list/heading_all.html'
+    ap_params['list_row'] = 'soc/student_project/list/row_all.html'
 
-    fun =  soc.cache.logic.cache(self._getData)
-    ap_logic = ap_params['logic']
-    entities = fun(logic.getModel(), filter, order=None, logic=ap_logic)
-    
-    ap_list = dicts.rename(ap_params, ap_params['list_params'])
-    ap_list['action'] = (redirects.getPublicRedirect, ap_params)
-    ap_list['description'] = description
-    ap_list['pagination'] = 'soc/list/no_pagination.html'
-    ap_list['heading'] = 'soc/student_project/list/heading_all.html'
-    ap_list['row'] = 'soc/student_project/list/row_all.html'
-    ap_list['data'] = entities
-
-    contents.append(ap_list)
-
-    params = params.copy()
-
-    return self._list(request, params, contents, page_name)
+    return self.list(request, access_type, page_name=page_name,
+                     params=ap_params, filter=filter)
 
   @decorators.merge_params
   @decorators.check_access