Question: What are the elements returned by the get method in widgets.get('list') in jinja2 templates?
ejm4567 opened this issue · 1 comments
This is a question about how the following code in the template appbuilder/general/model/list.html works.
In the example quickhowto2 the template list_contacts.html has:
{% block list_list scoped %}
Text before the list
{{ super() }}
{% endblock %}
There is an extends command at the top of that template which extends the list.html template, referenced above.
In list.html there is:
{% block list_list scoped %}
<div>
{{ widgets.get('list')()|safe }}
</div>
{% endblock %}
In the views.py file for quickhowto2 the widgets MyListWidget or MyListWidgetOverride are used. Both of those classes have as the parent class ListWidget. It's not clear to me where the "list" that MyListWidget and/or ListWidget comes from.
Would it be correct to assume that the "list" being requested via widgets.get are in a sense a "row" of a form?
Or is it something else ?
Any clarification/tips on how the above code is intended to work would be greatly appreciated!
I'll check later when im behind my computer. But if my memory serve correctly the widget that is specified in the model/view is used. The default for this is the ListWidget (if the data used is fitting the widget)