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.db import models
21 from django.contrib.localflavor.br.br_states import STATE_CHOICES as _states
22 from django.contrib.auth.models import User
25 STATE_CHOICES = [(x, unicode(y).encode('utf8')) for x, y in _states]
28 class Evento(models.Model):
29 nome = models.CharField(maxlength=100)
30 data_inicio = models.DateTimeField()
31 data_final = models.DateTimeField()
33 nome_local = models.CharField('Nome do local', maxlength=100)
34 nome_contato = models.CharField('Nome do contato', maxlength=100)
35 telefone = models.CharField(maxlength=100)
36 cidade = models.CharField(maxlength=100)
37 uf = models.CharField(maxlength=2, choices=STATE_CHOICES)
38 rua = models.CharField(maxlength=100)
39 numero = models.CharField('Número', maxlength=10)
40 info_adicional = models.TextField()
44 (None, {'fields': ('nome', 'data_inicio', 'data_final')}),
45 ('Informações da sede', {'fields': ('nome_local', 'nome_contato',
46 'cidade', 'uf', 'rua', 'numero', 'info_adicional')}),
53 class Palestrante(models.Model):
54 nome = models.CharField(maxlength=100)
55 email = models.CharField(maxlength=100)
57 telefone = models.CharField(maxlength=11, blank=True)
58 celular = models.CharField(maxlength=11, blank=True)
60 rua = models.CharField(maxlength=100)
61 numero = models.CharField(maxlength=10)
62 bairro = models.CharField(maxlength=100)
63 cidade = models.CharField(maxlength=100)
64 uf = models.CharField(maxlength=3)
66 minicurriculo = models.TextField('Mini currículo')
67 curriculo = models.TextField('Currículo')
69 usuario = models.ForeignKey(User)
73 (None, {'fields': ('nome', 'email', 'minicurriculo', 'usuario')}),
74 ('Telefones', {'fields': ('telefone', 'celular')}),
75 ('Endereço', {'fields': ('rua', 'numero',
76 'bairro', 'cidade', 'uf')}),
83 class Participante(models.Model):
84 nome = models.CharField(maxlength=100)
93 class CategoriaTrabalho(models.Model):
94 nome = models.CharField(maxlength=100)
100 verbose_name = 'Categoria de trabalho'
101 verbose_name_plural = 'Categorias de trabalhos'
107 class TipoTrabalho(models.Model):
108 nome = models.CharField(maxlength=100)
114 verbose_name = 'Tipo de trabalho'
115 verbose_name_plural = 'Tipos de trabalho'
121 class Trabalho(models.Model):
122 titulo = models.CharField(maxlength=100)
123 evento = models.ForeignKey(Evento)
124 categoria = models.ForeignKey(CategoriaTrabalho)
125 palestrante = models.ManyToManyField(Palestrante)
126 descricao_curta = models.TextField()
127 descricao_longa = models.TextField()
128 recursos = models.TextField()
132 (None, {'fields': ('titulo', 'evento', 'categoria',
133 'palestrante', 'descricao_curta', 'descricao_longa',
141 class Avaliacao(models.Model):
142 avaliador = models.ManyToManyField(User)
143 comentario = models.TextField()
144 trabalho = models.ForeignKey(Trabalho)
150 verbose_name = 'Avaliação'
151 verbose_name_plural = 'Avaliações'