You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to take a list of objects (QList<QObject *>), split it into "N" chunks, and build a separate (HTML) table for each chunk.
I'm doing something like:
{% range objectList.count as startNum %}
{% if startNum|divisibleby:16 %}
{% include "table.html.django" %}
{% endif %}
{% endrange %}
I've tried this for table.html.django:
<table>
<thead><tr><th>Name</th></tr></thead>
<tbody>
{% range startNum startNum|add:16 as num %}
<tr><td>{{ num }} {{ objectList.num.name }}</td></tr>
{% endrange %}
</tbody>
</table>
But that doesn't reference the list item properly and I don't see how to access a specific item in a list when I have a variable ("num"). Is there a way to do this?
I tried using slice, but looking at SliceFilter::doFilter() it seems like it only works on lists of strings. Is that correct?
Any suggestions on how to approach this?
(Also posted on StackOverflow, but no grantlee tag, so I'm guessing not too many people are using it over there.)
The text was updated successfully, but these errors were encountered:
I'm trying to take a list of objects (
QList<QObject *>
), split it into "N" chunks, and build a separate (HTML) table for each chunk.I'm doing something like:
I've tried this for table.html.django:
But that doesn't reference the list item properly and I don't see how to access a specific item in a list when I have a variable ("num"). Is there a way to do this?
I tried using slice, but looking at
SliceFilter::doFilter()
it seems like it only works on lists of strings. Is that correct?Any suggestions on how to approach this?
(Also posted on StackOverflow, but no grantlee tag, so I'm guessing not too many people are using it over there.)
The text was updated successfully, but these errors were encountered: