After some more tests, I have managed to understand where my problem is 
(but I don't know how to resolve it).
Here is my final piece of code :
<script type="text/javascript" src="{% static "js/geomap_var.js" %}"
></script>

<script type="text/javascript">
    my_markers = [
    {{ mymodel.set_first_call_true }}
    {% for current_addr in mymodel.addresses.all %}
        {% if not mymodel.first_call %},{% endif %}
        {
            lat: {{ current_addr.lat }},
            lon: {{ current_addr.lon }},
            description: {{ current_addr.description | safe }}
        }
    {{ mymodel.set_first_call_false }}
    {% endfor %}
    ];
</script>
    
<script type="text/javascript" src="{% static "js/geomap_body.js" %}"
></script>


I had to add an attribute "first_call" to mymodel, so that my javascript 
declaration was correct (in an array, we should always write the comma 
between 2 elements, but not after each element or before each element).
The only problem is that every time I call mymodel.set_first_call_true or 
mymodel.set_first_call_false, it inserts a "none" inside my javascript code.
Is it possible to "delete" the "non" statement ?


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/232757e4-0a4b-450f-808d-764453783dea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to