We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I found a case when using nested components re-rendering the parent does not run context processors properly.
I set up a minimal project here: https://github.com/denniseigner/django-unicorn-example
python version: 3.10.12 Django version: 4.2.10 django-unicorn version: 0.60.0
The interesting parts are the following:
djangoapp/context_processors/my_flag.py
from django.conf import settings def my_flag(request): return {"MY_FLAG": settings.MY_FLAG}
nested/templates/unicorn/overview.html
{% load unicorn %} <div> {% if MY_FLAG %} Flag {% else %} NoFlag {% endif %} {% unicorn 'list-implementation' list_items=list_items %} </div>
nested/components/list_filter.py
from django_unicorn.components import UnicornView class ListFilterView(UnicornView): search = "" def updated_search(self, query): self.parent.parent.load_items(query) self.parent.parent.force_render = True
When updated_search gets called, MY_FLAG gets unset and NoFlag will be displayed on the overview page.
updated_search
MY_FLAG
Is this intended behaviour?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I found a case when using nested components re-rendering the parent does not run context processors properly.
I set up a minimal project here: https://github.com/denniseigner/django-unicorn-example
python version: 3.10.12
Django version: 4.2.10
django-unicorn version: 0.60.0
The interesting parts are the following:
djangoapp/context_processors/my_flag.py
nested/templates/unicorn/overview.html
nested/components/list_filter.py
When
updated_search
gets called,MY_FLAG
gets unset and NoFlag will be displayed on the overview page.Is this intended behaviour?
The text was updated successfully, but these errors were encountered: