Basically web2py injects to the template things like html helpers and response or request objects, I just want to find how this is done, for example, the jinja2 templates has the Environment.globals list for include objects in the template context, I am looking for a functionality like that in the web2py templates.

Greetings.

El 23/1/19 a las 9:36 a.m., sandeep patel escribió:
Thanks for clarification @Carloas,
You can extend the template module classes. According to your need then you can inject whatever object you want as a default.
Please correct me if I am in the wrong direction

 Thanks
SP

On Wed, Jan 23, 2019 at 7:42 PM Carlos Cesar Caballero Díaz <carlos.caball...@cfg.jovenclub.cu <mailto:carlos.caball...@cfg.jovenclub.cu>> wrote:

    Hi sandeep patel, thanks for your answer.

    In my use case I am using the template module outside web2py as a
    standalone package, and I need to inject some objects in the
    template by default. I am not using the whole web2py framework.

    Greetings.

    El 23/1/19 a las 8:58 a.m., sandeep patel escribió:
    @ Carlos
    I think you can use the current app modules folder. This executes
    all the .py files on the top label of every request
    For more information here
    
<http://web2py.com/books/default/chapter/29/04/the-core#Sharing-the-global-scope-with-modules-using-the-current-object>

    Thanks
    SP

    On Wed, Jan 23, 2019 at 6:39 PM Carlos Cesar Caballero Díaz
    <carlos.caball...@cfg.jovenclub.cu
    <mailto:carlos.caball...@cfg.jovenclub.cu>> wrote:

        Hi guys, I am using the web2py templates in a side project
        and I want to
        include some variables in the environment by default,
        something like how
        helpers, request and response are included in the framework,
        but I can't
        find how this is done. Any idea?

        Greetings.


-- Resources:
        - http://web2py.com
        - http://web2py.com/book (Documentation)
        - http://github.com/web2py/web2py (Source code)
        - https://code.google.com/p/web2py/issues/list (Report Issues)
        ---
        You received this message because you are subscribed to the
        Google Groups "web2py-users" group.
        To unsubscribe from this group and stop receiving emails from
        it, send an email to web2py+unsubscr...@googlegroups.com
        <mailto:web2py%2bunsubscr...@googlegroups.com>.
        For more options, visit https://groups.google.com/d/optout.

-- Resources:
    - http://web2py.com
    - http://web2py.com/book (Documentation)
    - http://github.com/web2py/web2py (Source code)
    - https://code.google.com/p/web2py/issues/list (Report Issues)
    ---
    You received this message because you are subscribed to the
    Google Groups "web2py-users" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to web2py+unsubscr...@googlegroups.com
    <mailto:web2py+unsubscr...@googlegroups.com>.
    For more options, visit https://groups.google.com/d/optout.
-- Resources:
    - http://web2py.com
    - http://web2py.com/book (Documentation)
    - http://github.com/web2py/web2py (Source code)
    - https://code.google.com/p/web2py/issues/list (Report Issues)
    ---
    You received this message because you are subscribed to the Google
    Groups "web2py-users" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to web2py+unsubscr...@googlegroups.com
    <mailto:web2py+unsubscr...@googlegroups.com>.
    For more options, visit https://groups.google.com/d/optout.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com <mailto:web2py+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to