[Zope3-dev] Re: Add flexibility to zope.formlib.form.EditFormBase

Christian Zagrodnick cz at gocept.com
Wed May 9 02:06:18 EDT 2007


On 2007-05-08 08:02:37 +0200, Michael Howitz <mh at gocept.com> said:

> Am 07.05.2007 um 08:19 schrieb Christian Zagrodnick:
>>> You can, but there's a trick to it---call  handle_edit_action.success()
>>> instead of calling handle_edit_action directly.
>> 
>> Right. I used something like this here in a custom form:
>> 
>>    @zope.formlib.form.action(
>>        _("Apply"),
>>        condition=zope.formlib.form.haveInputWidgets)
>>    def handle_edit_action(self, action, data):
>>        super(EditForm, self).handle_edit_action.success(data)
>>        self.request.response.redirect(self.nextURL())
>>        return "Redirect..."
> 
> This looks not nice because you have to redeclare the whole action  
> including translation of the name and the condition.
> But if nobody agrees to my suggestion of a customizable applyChanges  I 
> will have to do it this way. (Although the two solutions do not  
> interfere.)

If it makes your life easier change it. I'm not really seeing the point 
in not chaning it, I was just posting my "solution".

-- 
Christian Zagrodnick

gocept gmbh & co. kg  ·  forsterstrasse 29 · 06112 halle/saale
www.gocept.com · fon. +49 345 12298894 · fax. +49 345 12298891





More information about the Zope3-dev mailing list