[albatross-users] ctx.locals.__page__ for random pages
Dave Cole
djc at object-craft.com.au
Sun Aug 17 20:18:12 EST 2003
> Is there a good reason why __page__ isn't set in ctx.locals for
> random apps? It's quite a useful piece of information to have
> available, here's some uses:
>
> * Makes it easy to create a run_template() equivalent which can
> handle a relative path, no need to worry what path the page is in.
> * Can be used a namespace for session management.
> * Will help with getting page_enter() and page_leave() working for
> random apps.
>
> I'm not entirely sure where the best place to make the change is:
> possibly in RandomPageModuleMixin but changing PageModuleMixin would
> be better.
For non-random page applications __page__ is already set when you
enter load_page_module(). For the time being I think that the right
place to set __page__ would be back in RandomPageModuleMixin.
It is probably a good idea to use ctx.locals.__page__. in
RandomPageModuleMixin.load_page() rather than ctx.locals.page_name.
- Dave
--
http://www.object-craft.com.au
More information about the Albatross-users
mailing list