I'm not sure about that -- maybe Massimo can answer. On Wednesday, July 20, 2011 2:18:23 PM UTC-4, Vincent wrote:
> Hi Anthony, > > thanks for clarifying that. I guess my question is then: > > why does it work in the default application without having to do "from > gluon.tools import prettydate" in the page.html view? > > Or more explicitly, what could cause the "prettydate" function to be > in the namespace in the page.html view in the fresh default app and > not in my app? > > thanks > Vincent > > On Jul 20, 9:09 am, Anthony <abas...@gmail.com> wrote: > > On Wednesday, July 20, 2011 8:11:56 AM UTC-4, Vincent wrote: > > > > > after some digging around I found the prettydate function in > > > gluon.tools. > > > > > If I "from gluon.tools import prettydate" directly in the page.html > > > view I no longer get an error. If I do the same thing but only in the > > > controller it still does not work. > > > > The views are not run in the same context as the controller, so if you > > import a module in a controller, it will not be available in the view. > > > > Anthony