0ed21197b3d078e927f468cb6e86156ff0e6f81e
[cascardo/ema.git] / eventos / models.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2008 Lincoln de Sousa <lincoln@minaslivre.org>
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 2 of the
7 # License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public
15 # License along with this program; if not, write to the
16 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 # Boston, MA 02111-1307, USA.
18 from django.db import models
19 from django.contrib.localflavor.br.br_states import STATE_CHOICES
20 from django.contrib.auth.models import User
21
22 class Evento(models.Model):
23     nome = models.CharField(max_length=100)
24     data_inicio = models.DateField(u'Data de início')
25     data_final = models.DateField()
26
27     local = models.CharField(max_length=100)
28     nome_contato = models.CharField(u'Nome do contato', max_length=100)
29     telefone = models.CharField(max_length=100)
30     cidade = models.CharField(max_length=100)
31     estado = models.CharField(max_length=2, choices=STATE_CHOICES)
32     rua = models.CharField(max_length=100)
33     numero = models.CharField(u'Número', max_length=10)
34     info_adicional = models.TextField(blank=True)
35
36     class Admin:
37         fields = (
38             (u'Informações do evento',
39              {'fields': ('nome', 'data_inicio', 'data_final')}),
40
41             (u'Informações da sede',
42              {'fields': ('local', 'nome_contato', 'rua', 'numero', 'cidade',
43                          'estado', 'telefone', 'info_adicional')}),
44         )
45
46     def __str__(self):
47         return self.nome
48
49 class Palestrante(models.Model):
50     nome = models.CharField(max_length=100)
51     email = models.CharField(max_length=100)
52
53     telefone = models.CharField(max_length=100, blank=True)
54     celular = models.CharField(max_length=100, blank=True)
55
56     instituicao = models.CharField(max_length=250, blank=True)
57
58     rua = models.CharField(max_length=100)
59     numero = models.CharField(max_length=10)
60     bairro = models.CharField(max_length=100)
61     cidade = models.CharField(max_length=100)
62     uf = models.CharField(max_length=3)
63
64     minicurriculo = models.TextField('Mini currículo')
65     curriculo = models.TextField('Currículo')
66
67     usuario = models.ForeignKey(User)
68
69     class Admin:
70         fields = (
71             (None, {'fields': ('nome', 'email', 'instituicao',
72                 'minicurriculo', 'curriculo')}),
73             ('Telefones', {'fields': ('telefone', 'celular')}),
74             ('Endereço', {'fields': ('rua', 'numero',
75                 'bairro', 'cidade', 'uf')}),
76         )
77
78     def __str__(self):
79         return self.nome