Yes, I know it. I very like bluebream because of pull (it's not for
propagation :)
And it's too hard for me to develop without it, but I try.

So, maybe is there a way to prepare some variables in some function
and then use it by calling prepare-function from needed function?

Something like:

mycontroller/
def options():
    a = ...
    b = db(...).select()
    return dict(a=a, b=b)

othercontroller/
def index():
    options = mycontroller/options()
    local_one = ...
    return dict(local_one=local_one, options=options)

index.html:
    {{=local_one}}
    {{if options['a']==True:}}
        helloworld
    {{pass}}

Is there a way to do something like this? ( >>>  options =
mycontroller/options()  <<< )

On 20 мар, 00:20, Massimo Di Pierro <massimo.dipie...@gmail.com>
wrote:
> There are two types of frameworks: push and pull.
>
> In push once controller pushes variables to one view.
>
> In pull one view pulls variables from multiple controllers.
>
> Web2py, Django, TG, Pylons, Pyramid, Flask, are push frameworks. You
> are trying to use a push framework as a pull one and that is not a
> good idea.
>
> You can ask the browser to pull variables. You can do is via Ajax or
> using the LOAD helper.
>
> massimo
>
> On Mar 19, 2:06 pm, LightOfMooN <vladsale...@yandex.ru> wrote:
>
>
>
>
>
>
>
> > How can I get variables in view from other controller?
>
> > For example:
> > mycontroller/
> > def options():
> >     return dict(a='hello', b='world')
>
> > and in some view I need something like this:
>
> > {{ options = mycontroller/options() }}
> > {{=a}} {{=b}}

Reply via email to