hi, my guess is that in the general case you probably don't want call one controller's action method from another controller's method. if what you want is make FooController.baz() a synonym of BarController.gnu() (that is, visiting /foo/baz has the same effect as visiting /bar/gnu) then a lot of time you'd just say either
return redirect_to( '/bar/gnu' ) in FooController.baz() or else return redirect_to( '/foo/baz' ) in BarController.gnu(); this will cause an HTTP 304 with the new location to be sent to the browser who will promptly issue a new request for the altered location. you may consider setting a flag in your session or maybe inspect HTTP request headers if it should be important to you that the client had called the alternative action and got redirected (either from /foo/baz to /bar/gnu or vice versa). if what you want is to take advantage of the functionality that is encapsulated in a piece of code that happened to end up in another controller chances are that this piece of code ended up in the wrong place. you could move that piece of code either into (1) a library module in application/lib/myLibrary.py, into (2) application/lib/ app_globals.py to make it globally available using the global g object, or else into (3) application/lib/base.py to make it a common method to all controllers. it would even be possible to set up a specialized class of controllers by inheriting from base.py/ BaseController and use that altered base controller as the base class of some of your controller classes. intriguing video, btw _wolf http://ontonym.net On Jan 12, 8:28 pm, "Konstantin Alexandrov" <[EMAIL PROTECTED]> wrote: > Hello all! > Please advise on the subject. > > --http://perceivingreality.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
