What about this?

(modules/mymodule.py)

def main(environment):
    environment = Storage(environment)
    cache = environment.cache

    @cache('xxx', time_expire=1, cache_model=cache.ram)
    def xxx():
       return 'xxx'

    return Storage(locals())

(in models or controllers)
local_import('mymodule').main(globals()).xxx()

Just an idea, and I don't know it's appropriate or not.

On 3月1日, 午前11:09, Massimo Di Pierro <massimo.dipie...@gmail.com>
wrote:
> Jonathan and I have a plan to make this easy but it will not be in
> until 1.93 or 1.94.
>
> On Feb 28, 3:12 pm, pbreit <pbreitenb...@gmail.com> wrote:
>
> > Yeah, I'm having a hard time figuring out when and how to put stuff in
> > modules. And what the implications are of putting functions in /models.

Reply via email to