X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=eventos%2Fmodels.py;h=d770b1f59d29e2f24788ed3f722aed5c719f5c40;hb=a90bc08fb15312d622c086502c4ec915baa50cb2;hp=3dd623ef3c814d146db0fe0b06da60fcce0f30e2;hpb=036722efd74222e5807a031952faa50bf0f71f32;p=cascardo%2Feventmanager.git diff --git a/eventos/models.py b/eventos/models.py index 3dd623e..d770b1f 100644 --- a/eventos/models.py +++ b/eventos/models.py @@ -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)