I created a patch. I do not have zope commit rights so I'm pasting it
here...
Index: plone.z3cform/plone/z3cform/fieldsets/utils.py
===================================================================
--- plone.z3cform/plone/z3cform/fieldsets/utils.py (Revision 106243)
+++ plone.z3cform/plone/z3cform/fieldsets/utils.py (Arbeitskopie)
@@ -%ld,%ld +%ld,%ld @@
relative = expandPrefix(relative_prefix) + relative
if field_name not in form.fields:
- raise KeyError("Field %s not found" % field_name)
+ found = False
+ for group in form.groups:
+ if field_name in group.fields:
+ found = True
+ break
+ if not found:
+ raise KeyError("Field %s not found" % field_name)
if relative != '*' and relative not in form.fields:
found = False
Index: plone.z3cform/plone/z3cform/fieldsets/README.txt
===================================================================
--- plone.z3cform/plone/z3cform/fieldsets/README.txt (Revision 106243)
+++ plone.z3cform/plone/z3cform/fieldsets/README.txt (Arbeitskopie)
@@ -%ld,%ld +%ld,%ld @@
... bar = schema.TextLine(title=u"Bar")
... baz = schema.TextLine(title=u"Baz")
... fub = schema.TextLine(title=u"Fub")
+ ... qux = schema.TextLine(title=u"Qux")
One plausible implementation is to use an annotation to store this
data.
@@ -%ld,%ld +%ld,%ld @@
... bar = u""
... baz = u""
... fub = u""
+ ... qux = u""
>>> ExtraBehavior = factory(ExtraBehavior)
>>> provideAdapter(ExtraBehavior)
@@ -%ld,%ld +%ld,%ld @@
...
... # Move 'baz' after 'bar'. This means it also moves
gropu.
... self.move('extra.baz', after='extra.bar')
+ ...
+ ... # Remove 'qux' and re-insert into 'Second' group,
+ ... # then move it before 'baz'
+ ... self.remove('qux', prefix='extra')
+ ... self.add(all_fields.select('qux', prefix='extra'),
group='Second')
+ ... self.move('qux', before='baz', prefix='extra',
relative_prefix='extra')
>>> provideAdapter(factory=ExtraBehaviorExtender,
name=u"test.extender")
@@ -%ld,%ld +%ld,%ld @@
This should have the group fields provided by the adapter as well.
>>> form.groups[0].fields.keys()
- ['extra.bar', 'extra.baz']
+ ['extra.bar', 'extra.qux', 'extra.baz']
On 7 Dez., 11:42, Martin Aspeli <
optil...@gmail.com> wrote:
> 2009/12/7 Thomas Buchberger <
thomas.buchber...@gmail.com>: