Salut,
ça fait trois jours que je me penche sur un problème. J'essaye de créer des vignettes dans mon application en utilisant sorl-thumbnail, mais j'ai une erreur que je n'arrive pas à résoudre.
Le code de mon template:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
{% for annonce in annonces %}
                <div class="pubs-block">
				{% if annonce.image_primaire %}
				{% thumbnail annonce.image_primaire 290x135 quality=90 as thumbs %}	
				{% endif %}
                    <a href="{% url index-annonce %}?reference={{annonce.reference}}"><img src="{% if annonce.image_primaire %}{{thumbs}}{% else %}{{MEDIA_URL}}annonce/no-image.png" width="100" height="100{% endif %}" alt="{{annonce.intitule}}" /></a>
                    <h5>{{annonce.intitule}}</h5>
                    <p>{{annonce.description|safe|removetags:"script"|linebreaksbr|capfirst|truncletters:90}}<br />
	<span class="to_400">{% if annonce.operation == "vente" %}Prix de vente:{% else %}Loyer:{% endif %}</span>&nbsp;&nbsp;<span class="red to_600">{{annonce.prix|argent}} {{annonce.devise}}{% if annonce.operation == "location" %} /mois {% endif %}</span><br />
	<span class="to_400">Op&eacute;ration:</span>&nbsp;&nbsp;<span class="blue to_600">{{annonce.get_operation_display}}</span>
					</p>
 
                    <a class="button" href="{% url index-annonce %}?reference={{annonce.reference}}"><span>plus d'information ici</span></a>  
                </div>
	{% endfor %}
Et l'erreur est:
TemplateSyntaxError at /
Caught TypeError while rendering: expected string or Unicode object, NoneType found
Merci