Hmm, it looks like it does it only for variables listed in the action's arguments. (In pylons.controllers.core.WSGIController._inspect_call()). I thought it did it for all routing args. So you could define your action as:
def.__before__(self, controller): # Sets c.controller c.controller = controller # Or do it again to be explicit. --Mike On Wed, May 28, 2008 at 1:24 PM, jerry <[EMAIL PROTECTED]> wrote: > > Hi Mike, > > c.controller auto-assignment doesn't seem to be implemented in > Routes1.8 -- > > (Pdb) list > 22 def index(self): > 23 import pdb; pdb.set_trace() > 24 -> #c.url_for_action = 'index' > (Pdb) !c.controller > 16:15:01,505 DEBUG [pylons.util] No attribute called controller found > on c object, returning empty string > '' > > Jerry > > On May 28, 11:30 am, "Mike Orr" <[EMAIL PROTECTED]> wrote: >> On Wed, May 28, 2008 at 3:50 AM, Christoph Haas <[EMAIL PROTECTED]> wrote: >> > Hi, Antonia... >> >> > first of all: please don't hijack threads. Start a new thread if you want >> > to post to this list. Don't just reply to a random posting. >> >> > On Mittwoch, 28. Mai 2008, Antonio Beamud Montero wrote: >> >> How I can get the controller name in the actual template context. For >> >> example, a site.mako template used by several controllers, I want to >> >> show the controller name with something like this: >> >> >> ${c.name} >> >> >> It's possible or I must define a property for every controller with it's >> >> name? >> >> > The routes dictionary contains the information you are after: >> >> > request.environ['pylons.routes_dict'] >> >> > You cann add a "def __before__(self)" in the lib/base.py and fill a >> > template variable with it to be used in the templates: >> >> > c.routes = request.environ['pylons.routes_dict'] >> >> > That would allows you to access the current controller's name in the >> > template as: >> >> > ${c.routes['controller']} >> >> Actually, it's easier than that: ${c.controller} >> >> Routing variables are automatically added to 'c'. >> >> -- >> Mike Orr <[EMAIL PROTECTED]> > > > -- Mike Orr <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---