Hi all,
I'm using Flask Appbuilder to develop an app for recording, tabulating and reporting votes for cars at a car show. I'm creating this on my local computer, pushing to Bitbucket and pulling to PythonAnywhere. It's worked just fine until now. In the code below I use a variable named currentClass to keep track of when the class of the cars changes. This works fine when running locally but when I deploy to PythonAnywhere the value of currentClass never changes from it's initial value of the empty string. The results set is being iterated over and the column values are being displayed in the table correctly. I've included the code xx{{currentClass}}xx{{currentVotes}}yy
below just to dump the values.
Can anyone give me a clue about where to look for problems?
Thanks!
<table class="table table-striped">
<thead>
<th> </th>
<th>Class</th>
<th>Votes</th>
<th>Description</th>
<th>Car #</th>
<th>Owner</th>
<th>Year</th>
<th>Model</th>
</thead>
<tbody>
{% set rowStyleFirstInClass = "border-top-style:solid;border-top-width:3px;border-top-color:black" %}
{% set rowStyleHighlight = "color:#000000;background-color:#ffbbbb;" %}
{% set rowStyleNormal = "color:#000000;background-color:#ffffff;" %}
{% set rowStyle = rowStyleNormal %}
{% set currentClass = "" %}
{% set currentVotes = 0 %}
{% for rec in results %}
{% if rec[0] != currentClass %}
{% set rowStyle = rowStyleFirstInClass %}
{% else %}
{% set rowStyle = rowStyleNormal %}
{% endif %}
<tr>
{% if rec[0] == currentClass %}
<td style="{{rowStyle}}"> </td>
{% else %}
<td style="{{rowStyle}}"><i class="fa fa-arrow-right"/>xx{{currentClass}}xx{{currentVotes}}yy</td>
{% endif %}
{% for field in rec %}
<td style = "{{rowStyle}}">{{field}}</td>
{% endfor %}
</tr>
{% set currentClass = rec[0] %}
{% set currentVotes = rec[1] %}
{% endfor %}
</tbody>
</table>