From 1bbf6d094f0125b720a7223890bf446f6f940e0f Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 30 Mar 2016 00:29:31 +0200 Subject: [PATCH] Fixes #29 --- mapa/forms.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mapa/forms.py b/mapa/forms.py index 621dd9e..a4c67ec 100644 --- a/mapa/forms.py +++ b/mapa/forms.py @@ -1,11 +1,16 @@ from django.forms import ModelForm from .models import Reporte +from tasas.models import Universidad from django.forms.widgets import Select from django.utils.functional import lazy from tasas.models import curso_choices class ReporteForm(ModelForm): + def __init__(self, *args, **kwargs): + super(ReporteForm, self).__init__(*args, **kwargs) + self.fields['universidad'].choices = [(e.id, "%s - %s" % (e.nombre, e.centro)) for e in Universidad.objects.all()] + class Meta: model = Reporte exclude = ('id','estado')