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

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -