Adding the *eventos* app
authorLincoln de Sousa <lincoln@minaslivre.org>
Mon, 30 Jun 2008 23:08:41 +0000 (20:08 -0300)
committerLincoln de Sousa <lincoln@minaslivre.org>
Mon, 30 Jun 2008 23:08:41 +0000 (20:08 -0300)
eventos/__init__.py [new file with mode: 0644]
eventos/models.py [new file with mode: 0644]
eventos/views.py [new file with mode: 0644]

diff --git a/eventos/__init__.py b/eventos/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/eventos/models.py b/eventos/models.py
new file mode 100644 (file)
index 0000000..0ed2119
--- /dev/null
@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2008 Lincoln de Sousa <lincoln@minaslivre.org>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+from django.db import models
+from django.contrib.localflavor.br.br_states import STATE_CHOICES
+from django.contrib.auth.models import User
+
+class Evento(models.Model):
+    nome = models.CharField(max_length=100)
+    data_inicio = models.DateField(u'Data de início')
+    data_final = models.DateField()
+
+    local = models.CharField(max_length=100)
+    nome_contato = models.CharField(u'Nome do contato', max_length=100)
+    telefone = models.CharField(max_length=100)
+    cidade = models.CharField(max_length=100)
+    estado = models.CharField(max_length=2, choices=STATE_CHOICES)
+    rua = models.CharField(max_length=100)
+    numero = models.CharField(u'Número', max_length=10)
+    info_adicional = models.TextField(blank=True)
+
+    class Admin:
+        fields = (
+            (u'Informações do evento',
+             {'fields': ('nome', 'data_inicio', 'data_final')}),
+
+            (u'Informações da sede',
+             {'fields': ('local', 'nome_contato', 'rua', 'numero', 'cidade',
+                         'estado', 'telefone', 'info_adicional')}),
+        )
+
+    def __str__(self):
+        return self.nome
+
+class Palestrante(models.Model):
+    nome = models.CharField(max_length=100)
+    email = models.CharField(max_length=100)
+
+    telefone = models.CharField(max_length=100, blank=True)
+    celular = models.CharField(max_length=100, blank=True)
+
+    instituicao = models.CharField(max_length=250, blank=True)
+
+    rua = models.CharField(max_length=100)
+    numero = models.CharField(max_length=10)
+    bairro = models.CharField(max_length=100)
+    cidade = models.CharField(max_length=100)
+    uf = models.CharField(max_length=3)
+
+    minicurriculo = models.TextField('Mini currículo')
+    curriculo = models.TextField('Currículo')
+
+    usuario = models.ForeignKey(User)
+
+    class Admin:
+        fields = (
+            (None, {'fields': ('nome', 'email', 'instituicao',
+                'minicurriculo', 'curriculo')}),
+            ('Telefones', {'fields': ('telefone', 'celular')}),
+            ('Endereço', {'fields': ('rua', 'numero',
+                'bairro', 'cidade', 'uf')}),
+        )
+
+    def __str__(self):
+        return self.nome
diff --git a/eventos/views.py b/eventos/views.py
new file mode 100644 (file)
index 0000000..60f00ef
--- /dev/null
@@ -0,0 +1 @@
+# Create your views here.