adicionando campo cpf_cnpj na inscrição individual
[cascardo/eventmanager.git] / eventos / models.py
index 3dd623e..d770b1f 100644 (file)
@@ -95,7 +95,12 @@ class Participante(models.Model):
     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()
 
     class Admin:
         pass
@@ -114,6 +119,13 @@ class Caravana(models.Model):
     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)