[request] don't init tabindex unnecessarily, since it's added to page data which will makes an ajax call to unload_page_data necessary oldstable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 28 Apr 2011 15:24:37 +0200
brancholdstable
changeset 7266 f625097d1e99
parent 7265 8eedf71f280e
child 7267 2fe2ed459e4d
[request] don't init tabindex unnecessarily, since it's added to page data which will makes an ajax call to unload_page_data necessary
web/request.py
--- a/web/request.py	Thu Apr 28 15:24:11 2011 +0200
+++ b/web/request.py	Thu Apr 28 15:24:37 2011 +0200
@@ -135,12 +135,12 @@
         """
         return self.set_varmaker()
 
-    def _get_tabindex_func(self):
+    def next_tabindex(self):
         nextfunc = self.get_page_data('nexttabfunc')
         if nextfunc is None:
             nextfunc = count(1).next
             self.set_page_data('nexttabfunc', nextfunc)
-        return nextfunc
+        return nextfunc()
 
     def set_varmaker(self):
         varmaker = self.get_page_data('rql_varmaker')
@@ -154,8 +154,6 @@
         or an anonymous connection is open
         """
         super(CubicWebRequestBase, self).set_session(session, user)
-        # tabindex generator
-        self.next_tabindex = self._get_tabindex_func()
         # set request language
         vreg = self.vreg
         if self.user: