From 44a4c6787f59c5d3037dcdc1ea5e29746080b3b4 Mon Sep 17 00:00:00 2001 From: Helmy Giacoman Date: Sun, 6 Feb 2011 15:55:10 -0600 Subject: [PATCH] agregando select despues de enviar el form --- encuesta/forms.py | 2 +- templates/fed/indicadores.html | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/encuesta/forms.py b/encuesta/forms.py index 6e8e81f..8cb91e7 100644 --- a/encuesta/forms.py +++ b/encuesta/forms.py @@ -8,7 +8,7 @@ class InfluenciaForm(forms.Form): tipo = forms.MultipleChoiceField(choices=TIPO_CHOICE, label='Modalidad de apoyo') - organizacion = forms.ModelMultipleChoiceField(queryset=Organizacion.objects.all(), label='Organizaciones')#, widget=forms.CheckboxSelectMultiple) + organizacion = forms.ModelMultipleChoiceField(queryset=None, label='Organizaciones')#, widget=forms.CheckboxSelectMultiple) resultado = forms.ModelMultipleChoiceField(queryset=Resultado.objects.all(), label='Resultados') periodo = forms.MultipleChoiceField(choices=CHOICE_PERIODO, label='Período') anio = forms.ChoiceField(choices=CHOICE_ANIO, label='Año') diff --git a/templates/fed/indicadores.html b/templates/fed/indicadores.html index eb44cc9..43f7531 100644 --- a/templates/fed/indicadores.html +++ b/templates/fed/indicadores.html @@ -10,7 +10,7 @@ verificar(); $("#id_tipo").change(function() { verificar(); - }); + }); $('#select_organizacion').click(function(){ $('#id_organizacion option').each(function(){ @@ -64,6 +64,9 @@ $('#id_organizacion').append($('').val(item.id).html(item.nombre_corto)); }); } + {% for o in orgs_aux %} + $('#id_organizacion option[value={{o.id}}]').attr('selected', true); + {% endfor %} }); }else{ verificar();