[Zope3-Users] Re: nextUrl(), passing state in formlib
Martin Aspeli
optilude at gmx.net
Sun Sep 10 14:16:49 EDT 2006
Jürgen Kartnaller wrote:
> I did it this way :
>
> The Edit Form implementation :
>
> class AddClub(zope.formlib.form.AddForm):
>
> base_template =zope.formlib.form.AddForm.template
> template = ViewPageTemplateFile('club_add.pt')
>
> ...
>
>
> def referer(self):
> return self.request.form.get('referer')\
> or self.request.getHeader('HTTP_REFERER')
>
> def nextURL(self):
> return self.request.form.get('referer','..')
>
>
> The template ('club_add.pt') :
>
> <div metal:use-macro="view/base_template/macros/main" >
> <div metal:fill-slot="extra_info">
> <input type="hidden" name="referer" value="" tal:attributes="value
> view/referer" />
> </div>
> </div>
Ah, excellent - thank you!
Martin
More information about the Zope3-users
mailing list