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()]
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()
descricao_longa = forms.CharField(widget=Textarea(),
label='Descrição longa')
+ palestrantes = forms.MultipleChoiceField()
+
class CadastroPalestrante(forms.Form):
def __init__(self, *args, **kwargs):