Can some one please explain me why the below code is not adding the value in current_count variable. Also I am using django version 1.3. The below code gives following output.
0
"image"
10
"image"
10
"image"
. . .
The "image" means actual image is shown.
What I want is "only show 4 images".
{% with current_count=0 %}
    {% for row in people|slice:":4" %}
        {% if row %}
            {% for event in row %}
                {% if current_count < 4 %}
                    {{current_count}}
                    <div class="latest-photos-image-box">
                        <a href="{{ event.get_absolute_url }}"><img src="{{ event.mainthumb.url }}" alt="{{ event.title }}" /></a>
                    </div>
                {% endif %}
                {{ current_count|add:"1" }}
            {% endfor %}
        {% endif %}
    {% endfor %}
{% endwith %}
 
     
     
    