Re: Catch unimplemented action

2009-03-27 Thread Wyatt Baldwin
On Mar 27, 1:37 pm, askel wrote: > Original poster says he wants to avoid NotImplementedError exception > which only happens in debug mode instead of returning 404. True, but he also mentioned users, so I guessed that he might not have known that he'd get a 404 instead of a NotImplementedError i

Re: Catch unimplemented action

2009-03-27 Thread askel
Original poster says he wants to avoid NotImplementedError exception which only happens in debug mode instead of returning 404. On Mar 25, 4:27 pm, Wyatt Baldwin wrote: > On Mar 25, 11:06 am, askel wrote: > > > Edgar, > > > I'd define controller's __getattr__ method and return some dummy > > ac

Re: Catch unimplemented action

2009-03-25 Thread Wyatt Baldwin
On Mar 25, 11:06 am, askel wrote: > Edgar, > > I'd define controller's __getattr__ method and return some dummy > action as following: > > def _dummy_action(self): >   ... > > def __getattr__(self, name): >   return self._dummy_action > > It will catch all other non-existant attribute requests bu

Re: Catch unimplemented action

2009-03-25 Thread askel
Edgar, I'd define controller's __getattr__ method and return some dummy action as following: def _dummy_action(self): ... def __getattr__(self, name): return self._dummy_action It will catch all other non-existant attribute requests but this is probably simpliest working solution. Cheers

Re: Catch unimplemented action

2009-03-24 Thread Wyatt Baldwin
On Mar 24, 10:45 am, edgarsmolow wrote: > Thanks, Tom. > But that document is out-of-date.  After reading that document, I > still don't understand the process or have a good example to follow. > Besides, ErrorController might not be what I'm looking for.  What > happens when a URL identifies a s

Re: Catch unimplemented action

2009-03-24 Thread edgarsmolow
By the way, I'm running Pylons 0.9.7. Edgar On Mar 24, 1:45 pm, edgarsmolow wrote: > Thanks, Tom. > But that document is out-of-date. After reading that document, I > still don't understand the process or have a good example to follow. > Besides, ErrorController might not be what I'm looking

Re: Catch unimplemented action

2009-03-24 Thread edgarsmolow
Thanks, Tom. But that document is out-of-date. After reading that document, I still don't understand the process or have a good example to follow. Besides, ErrorController might not be what I'm looking for. What happens when a URL identifies a specific controller and action, but the action has n

Re: Catch unimplemented action

2009-03-23 Thread Tom Longson (nym)
Check out the ErrorController (controllers/error.py). Here's more information on error handling in Pylons: http://wiki.pylonshq.com/display/pylonsdocs/Error+Documents Cheers, Tom Longson (nym) - Tackle Human Dilemmas. http://stopthespin.com/ On Mon, Mar 23, 2

Catch unimplemented action

2009-03-23 Thread edgarsmolow
My question is how to implement a catch-all for "bogus" URLs? Suppose the user manually enters a URL that does not have a corresponding action. Like this: http://mydomain.com/mycontroller/myaction Suppose "myaction" as an action (method) in controller "mycontroller" has not been implemented (i