2011/2/11 He Shiming <[email protected]>: > Dear Community, > > I'm wondering how to add a custom action to a rest controller? > > I used `paster restcontroller user users` to create UsersController. > Besides rest-style actions, I would like to add a custom one, so I > put: > > def validate(self): > return 'some stuff' > > However, /users/validate is always an empty page. There are also no > error messages. Do I need a custom route to make this work?
Yes. map.resource() builds default routes for controller (otherwise you would need do it manually with multiple map.connect() entries). If you want additional routes, just add the expilict route with map.connect(). Best regards, Cezary Statkiewicz -- Cezary Statkiewicz - [email protected] jabber://[email protected] http://thelirium.net -- You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en.
