X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=eventos%2Fmodels.py;h=ffc4ebcd1df05624eb4ad98c55d4cfa3390e4442;hb=a3c82375aad112d36ec7970eefaf2230859a2a83;hp=3dd623ef3c814d146db0fe0b06da60fcce0f30e2;hpb=036722efd74222e5807a031952faa50bf0f71f32;p=cascardo%2Feventmanager.git diff --git a/eventos/models.py b/eventos/models.py index 3dd623e..ffc4ebc 100644 --- a/eventos/models.py +++ b/eventos/models.py @@ -95,8 +95,11 @@ class Participante(models.Model): 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 @@ -114,6 +117,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)