adicionando o campo refbanco (controle de referências bancárias)
[cascardo/eventmanager.git] / eventos / models.py
index 84ee779..ffc4ebc 100644 (file)
@@ -1,4 +1,4 @@
-# -*- coding: utf8; -*-
+# -*- coding: utf-8; -*-
 """
 Copyright (C) 2007 Lincoln de Sousa <lincoln@archlinux-br.org>
 
@@ -41,9 +41,9 @@ class Evento(models.Model):
 
     class Admin:
         fields = (
-            (None, {'fields': ('nome', 'data_inicio', 'data_final')}),
+            ('Informações do evento', {'fields': ('nome', 'data_inicio', 'data_final')}),
             ('Informações da sede', {'fields': ('nome_local', 'nome_contato',
-                'cidade', 'uf', 'rua', 'numero', 'info_adicional')}),
+                'cidade', 'uf', 'rua', 'numero','telefone', 'info_adicional')}),
         )
 
     def __str__(self):
@@ -54,8 +54,10 @@ class Palestrante(models.Model):
     nome = models.CharField(maxlength=100)
     email = models.CharField(maxlength=100)
 
-    telefone = models.CharField(maxlength=11, blank=True)
-    celular = models.CharField(maxlength=11, blank=True)
+    telefone = models.CharField(maxlength=100, blank=True)
+    celular = models.CharField(maxlength=100, blank=True)
+
+    instituicao = models.CharField(maxlength=250, blank=True)
 
     rua = models.CharField(maxlength=100)
     numero = models.CharField(maxlength=10)
@@ -70,7 +72,8 @@ class Palestrante(models.Model):
 
     class Admin:
         fields = (
-            (None, {'fields': ('nome', 'email', 'minicurriculo', 'usuario')}),
+            (None, {'fields': ('nome', 'email', 'instituicao',
+                'minicurriculo', 'curriculo', 'usuario')}),
             ('Telefones', {'fields': ('telefone', 'celular')}),
             ('Endereço', {'fields': ('rua', 'numero',
                 'bairro', 'cidade', 'uf')}),
@@ -82,6 +85,20 @@ class Palestrante(models.Model):
 
 class Participante(models.Model):
     nome = models.CharField(maxlength=100)
+    email = models.CharField(maxlength=100)
+    rg = models.CharField(maxlength=100)
+    home_page = models.CharField(maxlength=100, blank=True)
+
+    telefone = models.CharField(maxlength=100, blank=True)
+    rua = models.CharField(maxlength=100)
+    numero = models.CharField(maxlength=10)
+    bairro = models.CharField(maxlength=100)
+    cidade = models.CharField(maxlength=100)
+    uf = models.CharField(maxlength=3)
+    cep = models.CharField(maxlength=8)
+    usuario = models.ForeignKey(User)
+
+    refbanco = models.IntegerField()
 
     class Admin:
         pass
@@ -90,6 +107,24 @@ class Participante(models.Model):
         return self.nome
 
 
+class Caravana(models.Model):
+    coordenador = models.ForeignKey(Participante)
+    participantes = models.TextField()
+
+    class Admin:
+        pass
+
+    def __str__(self):
+        return str(self.coordenador)
+
+    def parsed_participantes(self):
+        real_data = []
+        for i in self.participantes.split('\n'):
+            if i.strip():
+                nome, email = i.rsplit(' ', 1)
+                real_data.append({'nome': nome, 'email': email})
+        return real_data
+
 class CategoriaTrabalho(models.Model):
     nome = models.CharField(maxlength=100)
 
@@ -121,6 +156,7 @@ class TipoTrabalho(models.Model):
 class Trabalho(models.Model):
     titulo = models.CharField(maxlength=100)
     evento = models.ForeignKey(Evento)
+    tipo = models.ForeignKey(TipoTrabalho)
     categoria = models.ForeignKey(CategoriaTrabalho)
     palestrante = models.ManyToManyField(Palestrante)
     descricao_curta = models.TextField()