On Dec 18, 2007 2:46 PM, avdd <[EMAIL PROTECTED]> wrote:
>
> Quoth Jonathan LaCour (2007-12-19 06:54):
> >      pylons.c       -> pylons.request.state
> >      pylons.session -> pylons.request.session
> >      pylons.g       -> pylons.request.app_globals
>
> Excuse my ignorance, but why can't all these just be attributes of
> the controller instance?  An abstract base class provides
> properties to subclasses.  The controller is instantiated per
> request, so is already thread-local.  It can then be passed around
> as context to library methods instead of this fixation with
> module-globals.

Well, the idea is that any library function can access them without
passing them around.  Especially through functions that don't need
them themselves but something they call does.

But I only use them in controllers and templates, to keep my functions
decoupled from Pylons and a particular user interface.

> I thought the reasoning for ultra-short names is because of the
> tedium of passing context to the template namespace,

I believe the one-letter names came from Perl::Mason via Myghty.

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-devel@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-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to