[form] put unknown constructor args into extra_kwargs and consider them when looking for field display values
--- a/web/views/forms.py Tue Sep 29 12:42:24 2009 +0200
+++ b/web/views/forms.py Tue Sep 29 12:43:40 2009 +0200
@@ -82,6 +82,8 @@
self.form_add_hidden(key, val)
elif hasattr(self.__class__, key) and not key[0] == '_':
setattr(self, key, val)
+ else:
+ self.extra_kwargs[key] = val
# skip other parameters, usually given for selection
# (else write a custom class to handle them)
if mainform:
@@ -179,6 +181,8 @@
if value is None:
if field.name in rendervalues:
value = rendervalues[field.name]
+ elif field.name in self.extra_kwargs:
+ value = self.extra_kwargs[field.name]
else:
value = self.form_field_value(field, load_bytes)
if callable(value):