Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to override context in for a child template #8

Open
thibaudcolas opened this issue Feb 19, 2020 · 7 comments
Open

Impossible to override context in for a child template #8

thibaudcolas opened this issue Feb 19, 2020 · 7 comments
Assignees
Labels
bug Something isn't working django Related to Django templates capabilities
Milestone

Comments

@thibaudcolas
Copy link
Member

thibaudcolas commented Feb 19, 2020

In GitLab by @m1kola on Dec 14, 2017, 11:38

If you have a some_page.html&some_page.yaml and include_me.html&include_me.html and some_page.html includes include_me.html.

some_page.yaml with something like:

context:
  page:
    pk: 1
    title: "my title"

and include_me.yaml with something like:

context:
  page:
    title: "Title from include"

Title from include will appear on both patterns. It's impossible to override single key in some_page.html

cc @bcdickinson

@thibaudcolas
Copy link
Member Author

In GitLab by @m1kola on Dec 14, 2017, 11:42

Hm. Actually, probably my description is incorrect... I'll double check later

@thibaudcolas thibaudcolas added bug Something isn't working and removed kind/bug labels Feb 19, 2020
@thibaudcolas thibaudcolas added this to the Nice to have milestone Feb 24, 2020
@thibaudcolas thibaudcolas added the documentation Improvements or additions to documentation label Feb 24, 2020
@thibaudcolas
Copy link
Member Author

This feels like something that should at least documented if indeed an issue.

@thibaudcolas thibaudcolas added the django Related to Django templates capabilities label Feb 26, 2020
@bcdickinson
Copy link

To do this properly, we could take a leaf out of docker-compose's book and steal its MergeDict stuff: https://github.com/docker/compose/blob/df05472bcc6f1596e519a1e02f01cebd4e160011/compose/config/config.py#L984

@thibaudcolas
Copy link
Member Author

Mentioned in the docs as of #131.

@thibaudcolas thibaudcolas removed the documentation Improvements or additions to documentation label Oct 30, 2020
@thibaudcolas thibaudcolas added the help wanted Extra attention is needed label Jan 24, 2022
@thibaudcolas thibaudcolas removed the help wanted Extra attention is needed label Jan 24, 2022
@thibaudcolas
Copy link
Member Author

Closed in favour of #138.

@bcdickinson
Copy link

I'm going to repoen this, as it's not a strict duplicate. This is concerning the hiding of context values set in outer contexts by those set in included/extended template contexts, whereas #138 is about controlling the output of tags that are not explicitly called by included/extended template in inner contexts (I know, this makes my brain hurt too).

@bcdickinson bcdickinson reopened this Dec 9, 2022
@bcdickinson bcdickinson self-assigned this Dec 9, 2022
@bcdickinson
Copy link

I've come across https://github.com/clarketm/mergedeep which might be useful here.

@thibaudcolas thibaudcolas moved this to Low priority in Roadmap Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working django Related to Django templates capabilities
Projects
No open projects
Status: Low priority
Development

No branches or pull requests

2 participants