web/request.py
changeset 4366 d51f28ba9399
parent 4277 35cd057339b2
child 4459 f628abfb3a6c
--- a/web/request.py	Tue Jan 26 13:34:12 2010 +0100
+++ b/web/request.py	Tue Jan 26 13:36:55 2010 +0100
@@ -103,6 +103,17 @@
 
     @property
     def varmaker(self):
+        """the rql varmaker is exposed both as a property and as the
+        set_varmaker function since we've two use cases:
+
+        * accessing the req.varmaker property to get a new variable name
+
+        * calling req.set_varmaker() to ensure a varmaker is set for later ajax
+          calls sharing our .pageid
+        """
+        return self.set_varmaker()
+
+    def set_varmaker(self):
         varmaker = self.get_page_data('rql_varmaker')
         if varmaker is None:
             varmaker = rqlvar_maker()