Skip to content

Conversation

@laundmo
Copy link
Contributor

@laundmo laundmo commented Nov 12, 2024

This means various fixtures won't have to check if it exists.

Solves the issue that Auth overwrites the entire template_inject dict when Auth.inject is true.

follow-up/related ideas:

  • Unify the various things being added to the render context (request, HELPERS, URL), by adding them to template_inject from the start
  • Allow a way to define template helper functions without having to Inject() in each controller, using a decorator which stores them in a global variable added to template_inject like this
    @template_helper
    def myhelper():
        return "test"

@mdipierro mdipierro merged commit 9d5c779 into web2py:master Nov 13, 2024
7 checks passed
@laundmo laundmo deleted the better_template_inject branch January 28, 2025 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants