# HG changeset patch # User Bruce Tulloch # Date 1289732992 -39600 # Node ID 98e2d9267acbd629c3df4805448164011f3ca28b # Parent ee9b0349303e97e5d7cdd155ec22f641075072bf 15373 | allow indexargs_form filter variable exclusion | 15946 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: 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. diff -r ee9b0349303e -r 98e2d9267acb roundup/trunk/roundup/cgi/templating.py --- a/roundup/trunk/roundup/cgi/templating.py Sun Nov 14 16:27:19 2010 +1100 +++ b/roundup/trunk/roundup/cgi/templating.py Sun Nov 14 22:09:52 2010 +1100 @@ -2573,7 +2573,7 @@ """%d def indexargs_form(self, columns=1, sort=1, group=1, filter=1, - filterspec=1, search_text=1): + filterspec=1, search_text=1, exclude=[]): """ return the current index args as form elements """ l = [] sc = self.special_char @@ -2602,6 +2602,8 @@ if self.classname and filterspec: cls = self.client.db.getclass(self.classname) for k,v in self.filterspec.items(): + if k in exclude: + continue if type(v) == type([]): if isinstance(cls.get_transitive_prop(k), hyperdb.String): add(k, ' '.join(v))