use content of variable c in controller through h.url_for

2009-01-19 Thread Michael

Hi,

in an .mako template I can use the global variable c. Is there a way
to call an other controller from the template via h.url_for and still
use the content of the variable c as in the template?
In the called controller c seems to be empty again.

Regards,
Michael

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: use content of variable c in controller through h.url_for

2009-01-19 Thread Mike Orr

On Mon, Jan 19, 2009 at 2:54 AM, Michael m...@micm.eu wrote:

 Hi,

 in an .mako template I can use the global variable c. Is there a way
 to call an other controller from the template via h.url_for and still
 use the content of the variable c as in the template?
 In the called controller c seems to be empty again.

When you go to another controller via h.url_for, it's a separate
request with its own 'c' context.

If you want to call a controller action from a different controller,
you'd instantiate it and call it.  But Pylons does so much behind the
scenes to set up the controller that I don't know if that would work.
It would be better to put common code into a private method in a
superclass controller or in a separate function.

-- 
Mike Orr sluggos...@gmail.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---