From: Lincoln de Sousa Date: Mon, 13 Aug 2007 18:08:24 +0000 (-0300) Subject: adicionando lista de palestrantes no cadastro de palestra (para o caso de existir... X-Git-Url: http://git.cascardo.info/?p=cascardo%2Feventmanager.git;a=commitdiff_plain;h=c3983788fe6a990d28b8ea38d7f937e1b44461ed adicionando lista de palestrantes no cadastro de palestra (para o caso de existir mais de um palestrante) --- diff --git a/forms.py b/forms.py index bd94a5f..13c1d0f 100644 --- a/forms.py +++ b/forms.py @@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. from django import newforms as forms from django.newforms.widgets import Textarea, PasswordInput from eventmanager.eventos.models import \ - AreaDeInteresse, CategoriaPalestra, STATE_CHOICES + AreaDeInteresse, CategoriaPalestra, Palestrante, STATE_CHOICES MKCHOICES = lambda K:[(x.id, str(x)) for x in K.objects.all()] @@ -31,6 +31,9 @@ class InscreverPalestra(forms.Form): newchoices = MKCHOICES(CategoriaPalestra) self.fields['categoria'].choices = newchoices + newchoices = MKCHOICES(Palestrante) + self.fields['palestrantes'].choices = newchoices + titulo = forms.CharField(max_length=100) tema = forms.CharField(max_length=100) categoria = forms.ChoiceField() @@ -39,6 +42,8 @@ class InscreverPalestra(forms.Form): descricao_longa = forms.CharField(widget=Textarea(), label='Descrição longa') + palestrantes = forms.MultipleChoiceField() + class CadastroPalestrante(forms.Form): def __init__(self, *args, **kwargs):