Hi,
This question is about a customization of the Django admin.
As I understand, change_list.html
uses the search_form
templatetag, which then renders the template search_form.html
.
I want to customize search_form.html
to provide some on-hover tips for users. I’ve done that (using a templatetag of my own to generate the tips) and it works fine.
Now I need to customize the tips based on some session data. Unfortunately, while many admin templates can simply access {{ request.session.blah }}
, the search_form.html
template is rendered with a restricted context (defined in the search_form
function of admin_list.py
).
The question is: what’s the (best) way to pass the request info I need down to the search form template?
I’ve tried wrapping the {% search_form cl %}
expression in change_list.html
with a new variable binding the session info I need, but the variable is not visible either.
Any clue is much appreciated!
Thanks