Hello,

I have the following code:
>     @expose('animador.web.templates.websites.admin.edit')
>     def edit(self, website, **kwargs):
>         if pylons.tmpl_context.form_errors:
>             flash(_("Could not modify the %s web site") % website)
>         pylons.c.edit_site_form = EditWebsiteForm(
>             'edit_site',
>             action="/websites/admin/edit_website"
>         )
>         return dict(website=website)
>
>     @expose('animador.web.templates.websites.admin.index')
>     @validate(form=EditWebsiteForm(), error_handler=edit)
>     def edit_website(self, old_alias, new_alias):
>         website = Website.query().get(old_alias)
>         website.website_alias = new_alias
>         DBSession.save(website)
>         DBSession.commit()
>         params = {'old': old_alias, 'new': new_alias}
>         flash(_('The "%(old)s" web site has been renamed to %(new)s!') % \
>               params)
>         redirect('/websites/admin/')

How can I make that when validation doesn't succeed in edit_website() and the 
form is then sent back to edit(), the error handler defines its `website` 
parameter?

It seems like it's only called with keyword arguments.

Thanks in advance.
-- 
Gustavo Narea.
http://gustavonarea.net/

Get rid of unethical constraints! Switch to Freedomware:
http://softwareliberty.com/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to