Closed GoogleCodeExporter closed 9 years ago
Original comment by seb...@gmail.com
on 10 Jun 2010 at 2:12
Template tags written:
-coords for getting coordinates
-subcube to remove some dimensions
Original comment by seb...@gmail.com
on 11 Jun 2010 at 7:27
[deleted comment]
[deleted comment]
[deleted comment]
Template tags previously written are not convenient. The right thing to do is :
1. leave the data filtering and processing to the views
2. find a convenient way of navigating the data in the template. This data is
potentially regrouped by dimension(s). Maybe check towards teh *regroup*
standard template tag :
some crappy code I had to write :
{% regroup teams.measures by userunit as submeasures %}
{% for team in submeasures %}
<tr>
<td>{{ team.grouper }}</td>
{% if team.list.0.internal == 0 %}
<td>{{ team.list.0.measure }}</td>
<td>{{ team.list.1.measure }}</td>
{% else %}
<td>{{ team.list.1.measure }}</td>
<td>{{ team.list.0.measure }}</td>
{% endif %}
<td>{{ team.list.0.measure|add:team.list.1.measure }}</td>
</tr>
{% endfor %}
Would be better if can do :
{% regroup teams.itercubes by team as teamcubes %}
{% for teamcube in teamcubes %}
<tr>
<td>{{ teamcube.team }}</td>
{% regroup teamcube.itercubes by internal as intcubes %}
{% for intcube in intcubes %}
<td>{{ intcube.measure }}</td>
{% endfor %}
<td>{{ teamcube.measure }}</td>
</tr>
{% endfor %}
Original comment by seb...@gmail.com
on 22 Jun 2010 at 1:35
[deleted comment]
Replaced first attempts of tags and filters by one tag "subcubes" and one
filter "getconstraint".
Example :
<ul>
{% subcubes musician_cube by name, instrument as m_subcube %}
<li> {{ m_subcube|getconstraint:"instrument" }}
<ul>
{% subcubes m_subcube by name as i_subcube %}
<li>{{ i_subcube|getconstraint:"name" }} : {{ i_subcube.measure }}</li>
{% endfor %}
</ul>
</li>
{% endsubcubes %}
</ul>
Would for example output : ::
* Trumpet
- John : 9
- Jack : 67
- Miles : 1
* Saxophone
- Jean-michel : 10
...
Original comment by seb...@gmail.com
on 23 Jun 2010 at 1:27
Original issue reported on code.google.com by
seb...@gmail.com
on 10 Jun 2010 at 2:11