X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=eventos%2Fmodels.py;h=825f3dae2659d4262a85dc67760b99a0a40bd7fa;hb=838f1585f18722b3913b70363ca73a84305802f9;hp=d3dbb5e8f0f66a7b8d5e611805115af9e991ee92;hpb=003360f9f4758b9d5f614f18b1e00135eea8f66d;p=cascardo%2Feventmanager.git diff --git a/eventos/models.py b/eventos/models.py index d3dbb5e..825f3da 100644 --- a/eventos/models.py +++ b/eventos/models.py @@ -1,4 +1,4 @@ -# -*- coding: utf8; -*- +# -*- coding: utf-8; -*- """ Copyright (C) 2007 Lincoln de Sousa @@ -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): @@ -85,6 +85,22 @@ 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) + 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 @@ -93,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)