Hi,
following the doc it seems to be better to use the "super" method :
> return CrudRestController.put(self, * args, ** kw)
become
return super(MyCrudRestController, self).put(*args, **kw)
and again: thanks !
On Dec 27, 6:14 pm, Mauro Ciancio <[email protected]> wrote:
> Hello khaezzar:
>
> On Sun, Dec 27, 2009 at 2:09 PM, khaezzar <[email protected]> wrote:
> > Creating a put() method just make the "edit form" redirect me to a bad
> > request.
> > do you have an example that works with put() ?
>
> Yes, It worked for me. Here I leave you an example:
>
> class MyCrudRestController(CrudRestController):
> def __init__(self, * args, ** kw):
> CrudRestController.__init__(self, * args, ** kw)
>
> @expose('my_edit_template')
> def edit(self, * args, ** kw):
> return CrudRestController.edit(self, *args, ** kw)
>
> @expose()
> @registered_validate(error_handler=edit)
> def put(self, * args, ** kw):
> # put stuff
> return CrudRestController.put(self, * args, ** kw)
>
> Cheers!
> --
> Mauro Ciancio <maurociancio at gmail dot com>
--
You received this message because you are subscribed to the Google Groups
"TurboGears" 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?hl=en.