Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users

Question about InvariantsValidator on a GroupForm (z3c.form)

 

 

Zope users RSS feed   Index | Next | Previous | View Threaded


oliver.roch at brainson

Mar 18, 2009, 10:20 AM

Post #1 of 1 (529 views)
Permalink
Question about InvariantsValidator on a GroupForm (z3c.form)

Hi all,

i'm having a problem getting an InvariantsValidator working on a grouped form using z3c.form. Imagine the following setup:

class GroupOne(Group):
fields = Fields(IMyForm).select('second_attribute', 'third_attribute')

class GroupTwo(Group):
fields = Fields(IMyForm).select('fourth_attribute', 'fifth_attribute')

class MyForm(GroupForm, Form):
fields = Fields(IMyForm).select('first_attribute')
groups = (GroupOne, GroupTwo)


Now, the z3c.form.validator.Data object passed to my InvariantsValidator only contains the 'first_attribute'. I think this is caused by line 190 in field.py:

def validate(self, data):
fields = self.form.fields.values()

Why is this method only looking for form.fields and not aggregating form.fields and possible form.groups?

Is it an unsupported use case, or am i just not getting it?


Thanks,
Oliver
_______________________________________________
Zope maillist - Zope [at] zope
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Zope users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.