Hi all,

It seems that the GrowingTableForm/GrowingTableFieldSet (from tw.dynforms) is not working in case you encapsulate fields which require not to be empty.

Here is my test code:

class TestGrowingTableForm(twd.GrowingTableForm):
  children = [
    twf.TextField('testfield', validator=twfv.Int(not_empty=False, min=1), label_text="Label")
    twf.TextField('testfield_required', validator=twfv.Int(not_empty=True, min=1), label_text="Label")
  ]
test_form = TestGrowingTableForm('test_form', action="">
class MyController(BaseController):
  @expose('papirus.templates.wugroup-test')
  def test(self, **data):
    tg.tmpl_context.form = plf.test_form
    return dict(prefilled_values = data)
   
  @expose()
  @validate(plf.test_form, error_handler=test)
  def dotest(selft, **data):
    print data
    return "agaga :-)"
 
My Controller only show that form (this is a dummy test case).
* if all fields are allowed to be empty, it works fine.
* if at least one field need not to be empty, then the validation fails (this should be because of the empty auto-generated group of fields).

The strange part is that the validation seems to take into account the empty group of fields while the arguments (**data in my controller methods) does not show these.

Does anyone know how to fix this? Should I create a bug ?

Damien


--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.

Reply via email to