1 # -*- coding: utf8; -*-
3 Copyright (C) 2007 Lincoln de Sousa <lincoln@archlinux-br.org>
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public
16 License along with this program; if not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
20 from django import newforms as forms
21 from django.newforms.widgets import Textarea, PasswordInput
22 from eventmanager.eventos.models import \
23 AreaDeInteresse, CategoriaPalestra, Palestrante, STATE_CHOICES
25 MKCHOICES = lambda K:[(x.id, str(x)) for x in K.objects.all()]
27 class InscreverPalestra(forms.Form):
28 def __init__(self, *args, **kwargs):
29 super(InscreverPalestra, self).__init__(*args, **kwargs)
31 newchoices = MKCHOICES(CategoriaPalestra)
32 self.fields['categoria'].choices = newchoices
34 newchoices = MKCHOICES(Palestrante)
35 self.fields['outros_palestrantes'].choices = newchoices
37 titulo = forms.CharField(max_length=100)
38 tema = forms.CharField(max_length=100)
39 categoria = forms.ChoiceField()
40 descricao_curta = forms.CharField(widget=Textarea(),
41 label='Descrição curta')
42 descricao_longa = forms.CharField(widget=Textarea(),
43 label='Descrição longa')
45 outros_palestrantes = forms.MultipleChoiceField()
48 class CadastroPalestrante(forms.Form):
49 def __init__(self, *args, **kwargs):
50 super(CadastroPalestrante, self).__init__(*args, **kwargs)
52 newchoices = MKCHOICES(AreaDeInteresse)
53 self.fields['area_interesse'].choices = newchoices
55 nome_completo = forms.CharField(max_length=100)
56 nome_usuario = forms.CharField(max_length=100)
57 senha = forms.CharField(max_length=100, widget=PasswordInput())
58 email = forms.CharField(max_length=100)
60 telefone_comercial = forms.CharField(max_length=11, required=False)
61 telefone_residencial = forms.CharField(max_length=11, required=False)
62 telefone_celular = forms.CharField(max_length=11, required=False)
64 instituicao = forms.CharField(max_length=100, label='Instituição')
65 minicurriculo = forms.CharField(widget=Textarea(), label='Mini Currículo')
67 rua = forms.CharField(max_length=100)
68 numero = forms.CharField(max_length=10, label='Número')
69 bairro = forms.CharField(max_length=100)
70 cidade = forms.CharField(max_length=100)
71 uf = forms.ChoiceField(choices=STATE_CHOICES)
73 area_interesse = forms.MultipleChoiceField(label='Áreas de Interesse')
76 class Inscricao(forms.Form):
77 nome_completo = forms.CharField(max_length=100)
78 cpf = forms.CharField(max_length=100)
79 email = forms.CharField(max_length=100)
81 rua = forms.CharField(max_length=100)
82 numero = forms.CharField(max_length=10, label='Número')
83 bairro = forms.CharField(max_length=100)
84 cidade = forms.CharField(max_length=100)
85 uf = forms.ChoiceField(choices=STATE_CHOICES)