funkybob / django-sniplates

Template snippet libraries for Django
MIT License
57 stars 18 forks source link

Passing incorrect arguments should not fail silently #1

Closed nlhkabu closed 10 years ago

nlhkabu commented 10 years ago

bootstrap.html:

{% block label %}
    <span class="label label-{{ label_type|default:'default' }}">
        {{ text }}
    </span>
{% endblock %}

template.html

{% load sniplates %}
{% load_widgets bootstrap="bootstrap.html" %}
{% widget "bootstrap:label" labell_type="error" text="Things go here" %}

In the case above, labell_type is ignored altogether - it would be nice if the template author could be told there is a problem.

funkybob commented 10 years ago

This would require parsing the template fragment and trying to guess all the variables involved.

This isn't done for {% include %} and friends for a very good reason -- it's massively complex.