Tom Andrews
2018-07-17 11:17:10 UTC
Hello,
I'm trying to construct a treeview-like structure with checkbox widgets
from deform and have all of the checkboxes as part of one form. If I just
render the form normally and pass the generated html to my template, I'll
obviosuly not get the structure I want.
So far I've tried to pass the whole form object to the template and then
rendering the individual checkboxes on demand with the templating language,
but then I'm missing a submit button and the whole form element, along with
a few other things. What are my options here? I'm certain that this must be
possible to do, but I can't seem to find a practical way to do it.
Here is the relevant excerpt from my template (jinja2):
<div class="treeview">
<ul>
{% for label_name, sublabels in view.gitlab_data.items() %}
<li class="tierone">
<span class="noselect"><i class="glyphicon glyphicon-plus"></i>{{ label_name }}</span>
<ul>
{% for sublabel_name, issues in sublabels.items() %}
<li class="tiertwo">
<span class="noselect"><i class="glyphicon glyphicon-plus"></i>{{ sublabel_name }}</span>
<ul>
{% for issue_id, issue in issues.items() %}
<li class="issue">
{# Insert Checkbox Nodes here#}
<a href={{ issue_id }}>
{{ issue.title }}
</a>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</div>
Thanks.
I'm trying to construct a treeview-like structure with checkbox widgets
from deform and have all of the checkboxes as part of one form. If I just
render the form normally and pass the generated html to my template, I'll
obviosuly not get the structure I want.
So far I've tried to pass the whole form object to the template and then
rendering the individual checkboxes on demand with the templating language,
but then I'm missing a submit button and the whole form element, along with
a few other things. What are my options here? I'm certain that this must be
possible to do, but I can't seem to find a practical way to do it.
Here is the relevant excerpt from my template (jinja2):
<div class="treeview">
<ul>
{% for label_name, sublabels in view.gitlab_data.items() %}
<li class="tierone">
<span class="noselect"><i class="glyphicon glyphicon-plus"></i>{{ label_name }}</span>
<ul>
{% for sublabel_name, issues in sublabels.items() %}
<li class="tiertwo">
<span class="noselect"><i class="glyphicon glyphicon-plus"></i>{{ sublabel_name }}</span>
<ul>
{% for issue_id, issue in issues.items() %}
<li class="issue">
{# Insert Checkbox Nodes here#}
<a href={{ issue_id }}>
{{ issue.title }}
</a>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</div>
Thanks.
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+***@googlegroups.com.
To post to this group, send email to pylons-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/1649b593-adad-45bb-a6c0-aac1bf1e56bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+***@googlegroups.com.
To post to this group, send email to pylons-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/1649b593-adad-45bb-a6c0-aac1bf1e56bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.