AW: [Zope3-checkins] Re: [Checkins]
SVN:z3c.form/branches/pcardune-tweaks/src/z3c/form/button.pyadded
an adapter hook to allow for customized ButtonActionobjects.
Not sure what the best way to test this is.
Roger Ineichen
dev at projekt01.ch
Tue Jun 19 12:25:31 EDT 2007
Hi Stephan, Paul
> Betreff: [Zope3-checkins] Re: [Checkins]
> SVN:z3c.form/branches/pcardune-tweaks/src/z3c/form/button.pyad
> ded an adapter hook to allow for customized
> ButtonActionobjects. Not sure what the best way to test this is.
>
> On Thursday 14 June 2007 09:42, Paul Carduner wrote:
> > Modified: z3c.form/branches/pcardune-tweaks/src/z3c/form/button.py
> > ===================================================================
> > --- z3c.form/branches/pcardune-tweaks/src/z3c/form/button.py
> > 2007-06-14
> > 13:39:36 UTC (rev 76693) +++
> > z3c.form/branches/pcardune-tweaks/src/z3c/form/button.py
> 2007-06-14
> > 13:42:53 UTC (rev 76694) @@ -221,7 +221,12 @@
> > if button.condition is not None and not
> > button.condition(self.form): continue
> > fullName = prefix + name
> > - buttonAction = ButtonAction(self.request, button,
> > fullName)
> > + # Look up a button action factory
> > + buttonAction = zope.component.queryMultiAdapter(
> > + (self.request, button, fullName),
> > + interfaces.IFieldWidget)
> > + # if one is not found, use the default
> > + if buttonAction is None:
> > + buttonAction = ButtonAction(self.request, button,
> > fullName) # Look up a potential custom title for the action.
> > title = zope.component.queryMultiAdapter(
> > (self.form, self.request, self.content, button,
> > self),
Including the prefix in the adapter name isn't a good idea.
And why not use the form itself as a adapter discriminator.
Probably I'm totaly wrong because I didn't take a look at the
source code.
Regards
Roger Ineichen
> Looks good; this can be added to the trunk, after an
> appropriate test is written.
>
> Regards,
> Stephan
> --
> Stephan Richter
> CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D.
> student) Web2k - Web Software Design, Development and
> Training _______________________________________________
> Zope3-Checkins mailing list
> Zope3-Checkins at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-checkins
>
More information about the Zope3-Checkins
mailing list