Added time to presentations and order by it
[cascardo/eventmanager.git] / eventos / models.py
index 9b2b233..36f17f8 100644 (file)
@@ -87,16 +87,20 @@ 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)
+    home_page = models.CharField(maxlength=100, blank=True)
 
     telefone = models.CharField(maxlength=100, blank=True)
-    celular = 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)
+    cpf_cnpj = models.CharField(maxlength=20, blank=True)
+
+    comercial = models.BooleanField(default=False)
+    usuario = models.ForeignKey(User)
+    refbanco = models.IntegerField(editable=False)
 
     class Admin:
         pass
@@ -105,6 +109,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)
 
@@ -142,12 +164,16 @@ class Trabalho(models.Model):
     descricao_curta = models.TextField()
     descricao_longa = models.TextField()
     recursos = models.TextField()
+    aprovado = models.BooleanField()
+    dia = models.DateField()
+    time_start = models.TimeField()
+    time_end = models.TimeField()
 
     class Admin:
         fields = (
-            (None, {'fields': ('titulo', 'evento', 'categoria',
+            (None, {'fields': ('titulo', 'evento', 'categoria', 'tipo',
                 'palestrante', 'descricao_curta', 'descricao_longa',
-                'recursos')}),
+                'recursos', 'aprovado', 'dia', 'time_start', 'time_end')}),
         )
 
     def __str__(self):