librelist archives

« back to archive

How to send var to jinja from flask decorator?

How to send var to jinja from flask decorator?

From:
chrickso
Date:
2013-04-07 @ 04:47
Please see question here for details?

http://stackoverflow.com/questions/15858947/how-can-i-send-variables-to-jinja-template-from-a-flask-decorator

Thanks!

- chrickso

Re: [flask] How to send var to jinja from flask decorator?

From:
Owein Reese
Date:
2013-04-07 @ 13:40
I posted a reply to your SO question here (
http://stackoverflow.com/a/15859225/178060) but I'll say it on the mailing
list, I think you're over complicating it. You just need a new
render_template function which always calls that method and adds those
variables to the rendered template. For inspiration, look at this
Flask-Snippet: http://flask.pocoo.org/snippets/15/

Hope that helps.


On Sun, Apr 7, 2013 at 12:47 AM, chrickso <chrickso@gmail.com> wrote:

> Please see question here for details?
>
> 
http://stackoverflow.com/questions/15858947/how-can-i-send-variables-to-jinja-template-from-a-flask-decorator
>
> Thanks!
>
> - chrickso
>

Re: [flask] How to send var to jinja from flask decorator?

From:
Owein Reese
Date:
2013-04-07 @ 13:55
Ooops, wrong link (http://stackoverflow.com/a/15862998/178060) Careless me.


On Sun, Apr 7, 2013 at 9:40 AM, Owein Reese <owreese@gmail.com> wrote:

> I posted a reply to your SO question here (
> http://stackoverflow.com/a/15859225/178060) but I'll say it on the
> mailing list, I think you're over complicating it. You just need a new
> render_template function which always calls that method and adds those
> variables to the rendered template. For inspiration, look at this
> Flask-Snippet: http://flask.pocoo.org/snippets/15/
>
> Hope that helps.
>
>
> On Sun, Apr 7, 2013 at 12:47 AM, chrickso <chrickso@gmail.com> wrote:
>
>> Please see question here for details?
>>
>> 
http://stackoverflow.com/questions/15858947/how-can-i-send-variables-to-jinja-template-from-a-flask-decorator
>>
>> Thanks!
>>
>> - chrickso
>>
>
>

Re: [flask] How to send var to jinja from flask decorator?

From:
Date:
2013-04-09 @ 02:55
On Sun, Apr 7, 2013 at 12:47 AM, chrickso <chrickso@gmail.com> wrote:

>
> 
http://stackoverflow.com/questions/15858947/how-can-i-send-variables-to-jinja-template-from-a-flask-decorator


Just quickly looking at the question, looks as if you want a context
processor:

https://gist.github.com/thrisp/5342561