If Statement not work in template in django -
i've problem if statement in template using django , jade (pre-preprocessor).
when submit form post , i've error, view return template values, work fine!! except following:
select(id='id_{{ afiliado_form.tipo_identificacion.html_name }}', name='{{ afiliado_form.tipo_identificacion.html_name }}', class='span4') {% id, tipo in afiliado_form.tipo_identificacion.field.choices %} {% if afiliado_form.tipo_identificacion.value == id %} option(value='{{ id }}', selected='selected' ) {{ tipo }} {% else %} option(value='{{ id }}', ) {{ tipo }} {% endif %} {% endfor %}
in afiliado_form.tipo_identificacion
i've:
(u'', u'---------') (1l, u'cedula de ciudadanÃa') (2l, u'nit') (3l, u'nn') (4l, u'pasaporte') (5l, u'cedula de extranjeria') (6l, u'tarjeta de identidad') (7l, u'nuip') (8l, u'carnet diplomatico')
and afiliado_form.tipo_identificacion.value
value that's sent. when renderize template "if" not work, not selected item!!
Comments
Post a Comment