diff CHANGES.txt @ 5082:c1f1465d5303

issue2550683 Allow indexargs_form filter variable exclusion. Patch generated by Bruce Tulloch (bruce). Applied and docstring for indexargs_form updated by John Rouillard. Full patch description is in CHANGES.txt file. I added the use case description. Code should be backwards compatible. There are not existing tests of indexargs_form that I can adopt to test, but it didn't cause tests/test_cgi tests/test_template to fail and the demo tracker ran properly.
author John Rouillard <rouilj@ieee.org>
date Sat, 11 Jun 2016 19:17:49 -0400
parents 786f0581bc90
children 1c992cb4301a
line wrap: on
line diff
--- a/CHANGES.txt	Sat Jun 11 18:06:18 2016 -0400
+++ b/CHANGES.txt	Sat Jun 11 19:17:49 2016 -0400
@@ -40,6 +40,33 @@
 - issue2109308 - Allow subject of nosy messages be changed from reactor
   Adds a subject parameter to nosymessage function. Patch initally
   generated by Frank Niessink. Tests, adaptation by John Rouillard.
+- issue2550683 Allow indexargs_form filter variable exclusion.
+  Patch generated by Bruce Tulloch (bruce). Applied and docstring for
+  indexargs_form updated by John Rouillard. Patch description is:
+  This is required to allow indexargs_form to be used in conjunction with
+  other form variables which *replace* some filterspec parameters.
+
+  One must exclude all variables from the indexargs_form call which are to
+  be replaced with values that are derived from other form input elements,
+  otherwise they will clash with the "hidden" input elements generated by
+  indexargs_form itself.
+
+  For example:
+    <tal:block replace="structure python:request.indexargs_form(
+                      sort=0,group=0,filter=0,columns=0,
+                      exclude=['type','status','assignedto'])"/>
+  where the variables type, status and assignedto are supplied via other
+  form input elements. Without the new exclude argument to indexargs_form,
+  all hidden input elements otherwise generated by this call would need to
+  be manually added to the template code. Further, given that the template
+  may not know what other variables may be defined, it may not even be
+  possible to code this without some python helpers.
+    [ rouilj I think this is an example usecase. Possible assignedto
+    users need to have a specific role. Create TAL that
+    filters the users to the select few. Defines a select list for
+    assignedto. Use exclude=['assignedto'] to prevent the
+    indexargs_form from generating a confliciting assignedto field
+    which lists all users regardless of the role.]
 
 Fixed:
 

Roundup Issue Tracker: http://roundup-tracker.org/