From 1be1713737f634267ce431ffe239bd3287c32ea1 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 7 Mar 2016 09:10:01 -0300 Subject: [PATCH 1/2] Adiciona EmailField e URLField aos campos --- base/migrations/0009_auto_20160307_0905.py | 25 +++++++++++++++++++ base/models.py | 4 +-- .../migrations/0004_auto_20160307_0905.py | 20 +++++++++++++++ comissoes/models.py | 5 ++-- materia/migrations/0021_auto_20160307_0905.py | 20 +++++++++++++++ materia/models.py | 4 +-- .../migrations/0012_auto_20160307_0905.py | 25 +++++++++++++++++++ parlamentares/models.py | 6 ++--- 8 files changed, 100 insertions(+), 9 deletions(-) create mode 100644 base/migrations/0009_auto_20160307_0905.py create mode 100644 comissoes/migrations/0004_auto_20160307_0905.py create mode 100644 materia/migrations/0021_auto_20160307_0905.py create mode 100644 parlamentares/migrations/0012_auto_20160307_0905.py diff --git a/base/migrations/0009_auto_20160307_0905.py b/base/migrations/0009_auto_20160307_0905.py new file mode 100644 index 000000000..adecc2ac3 --- /dev/null +++ b/base/migrations/0009_auto_20160307_0905.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9 on 2016-03-07 12:05 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('base', '0008_auto_20160216_1015'), + ] + + operations = [ + migrations.AlterField( + model_name='casalegislativa', + name='email', + field=models.EmailField(blank=True, max_length=100, verbose_name='E-mail'), + ), + migrations.AlterField( + model_name='casalegislativa', + name='endereco_web', + field=models.URLField(blank=True, max_length=100, verbose_name='HomePage'), + ), + ] diff --git a/base/models.py b/base/models.py index 8915ff94d..9080d75e0 100644 --- a/base/models.py +++ b/base/models.py @@ -29,9 +29,9 @@ class CasaLegislativa(models.Model): blank=True, upload_to=get_casa_media_path, verbose_name=_('Logotipo')) - endereco_web = models.CharField( + endereco_web = models.URLField( max_length=100, blank=True, verbose_name=_('HomePage')) - email = models.CharField( + email = models.EmailField( max_length=100, blank=True, verbose_name=_('E-mail')) informacao_geral = models.CharField( max_length=100, diff --git a/comissoes/migrations/0004_auto_20160307_0905.py b/comissoes/migrations/0004_auto_20160307_0905.py new file mode 100644 index 000000000..0cad7d62e --- /dev/null +++ b/comissoes/migrations/0004_auto_20160307_0905.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9 on 2016-03-07 12:05 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('comissoes', '0003_auto_20160216_1015'), + ] + + operations = [ + migrations.AlterField( + model_name='comissao', + name='email', + field=models.EmailField(blank=True, max_length=100, verbose_name='E-mail'), + ), + ] diff --git a/comissoes/models.py b/comissoes/models.py index 6876debc2..6e41e0e01 100644 --- a/comissoes/models.py +++ b/comissoes/models.py @@ -67,8 +67,9 @@ class Comissao(models.Model): max_length=100, blank=True, verbose_name=_('Local Reunião')) finalidade = models.TextField( blank=True, verbose_name=_('Finalidade')) - email = models.CharField( - max_length=100, blank=True, verbose_name=_('E-mail')) + email = models.EmailField(max_length=100, + blank=True, + verbose_name=_('E-mail')) unidade_deliberativa = models.BooleanField( choices=YES_NO_CHOICES, verbose_name=_('Unidade Deliberativa')) diff --git a/materia/migrations/0021_auto_20160307_0905.py b/materia/migrations/0021_auto_20160307_0905.py new file mode 100644 index 000000000..b7e65bc30 --- /dev/null +++ b/materia/migrations/0021_auto_20160307_0905.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9 on 2016-03-07 12:05 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('materia', '0020_auto_20160229_1324'), + ] + + operations = [ + migrations.AlterField( + model_name='acompanhamentomateria', + name='email', + field=models.EmailField(max_length=100, verbose_name='E-mail'), + ), + ] diff --git a/materia/models.py b/materia/models.py index 70282b719..5da4beb89 100644 --- a/materia/models.py +++ b/materia/models.py @@ -136,8 +136,8 @@ class MateriaLegislativa(models.Model): class AcompanhamentoMateria(models.Model): usuario = models.CharField(max_length=50) materia = models.ForeignKey(MateriaLegislativa) - email = models.CharField( - max_length=100, verbose_name=_('Endereço de E-mail')) + email = models.EmailField( + max_length=100, verbose_name=_('E-mail')) data_cadastro = models.DateField(auto_now_add=True) hash = models.CharField(max_length=8) confirmado = models.BooleanField(default=False) diff --git a/parlamentares/migrations/0012_auto_20160307_0905.py b/parlamentares/migrations/0012_auto_20160307_0905.py new file mode 100644 index 000000000..c3d0cac90 --- /dev/null +++ b/parlamentares/migrations/0012_auto_20160307_0905.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9 on 2016-03-07 12:05 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('parlamentares', '0011_auto_20160216_1015'), + ] + + operations = [ + migrations.AlterField( + model_name='parlamentar', + name='email', + field=models.EmailField(blank=True, max_length=100, verbose_name='E-mail'), + ), + migrations.AlterField( + model_name='parlamentar', + name='endereco_web', + field=models.URLField(blank=True, max_length=100, verbose_name='HomePage'), + ), + ] diff --git a/parlamentares/models.py b/parlamentares/models.py index cfa74758b..910d47f25 100644 --- a/parlamentares/models.py +++ b/parlamentares/models.py @@ -253,14 +253,14 @@ class Parlamentar(models.Model): max_length=50, blank=True, verbose_name=_('Fax Residencial')) - endereco_web = models.CharField( + endereco_web = models.URLField( max_length=100, blank=True, verbose_name=_('HomePage')) profissao = models.CharField( max_length=50, blank=True, verbose_name=_('Profissão')) - email = models.CharField( + email = models.EmailField( max_length=100, blank=True, - verbose_name=_('Correio Eletrônico')) + verbose_name=_('E-mail')) locais_atuacao = models.CharField( max_length=100, blank=True, From 0c34b85b10f9bdc5e9e27ac1ef44a1e296074ae4 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 7 Mar 2016 09:20:42 -0300 Subject: [PATCH 2/2] =?UTF-8?q?Adi=C3=A7=C3=A3o=20de=20URLField=20em=20com?= =?UTF-8?q?pila=C3=A7=C3=A3o,=20lexml,=20e=20sess=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0044_auto_20160307_0918.py | 25 +++++++++++++ compilacao/models.py | 4 +-- lexml/migrations/0004_auto_20160307_0918.py | 25 +++++++++++++ lexml/models.py | 4 +-- sessao/migrations/0015_auto_20160307_0918.py | 35 +++++++++++++++++++ sessao/models.py | 6 ++-- 6 files changed, 92 insertions(+), 7 deletions(-) create mode 100644 compilacao/migrations/0044_auto_20160307_0918.py create mode 100644 lexml/migrations/0004_auto_20160307_0918.py create mode 100644 sessao/migrations/0015_auto_20160307_0918.py diff --git a/compilacao/migrations/0044_auto_20160307_0918.py b/compilacao/migrations/0044_auto_20160307_0918.py new file mode 100644 index 000000000..302524708 --- /dev/null +++ b/compilacao/migrations/0044_auto_20160307_0918.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9 on 2016-03-07 12:18 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('compilacao', '0043_auto_20160110_1733'), + ] + + operations = [ + migrations.AlterField( + model_name='nota', + name='url_externa', + field=models.URLField(blank=True, max_length=1024, verbose_name='Url externa'), + ), + migrations.AlterField( + model_name='publicacao', + name='url_externa', + field=models.URLField(blank=True, max_length=1024, verbose_name='Link para Versão Eletrônica'), + ), + ] diff --git a/compilacao/models.py b/compilacao/models.py index eaa0a52c4..c7e9f7f05 100644 --- a/compilacao/models.py +++ b/compilacao/models.py @@ -459,7 +459,7 @@ class Publicacao(TimestampedMixin): edicao = models.PositiveIntegerField( blank=True, null=True, verbose_name=_('Edição')) - url_externa = models.CharField( + url_externa = models.URLField( max_length=1024, blank=True, verbose_name=_('Link para Versão Eletrônica')) @@ -1169,7 +1169,7 @@ class Nota(TimestampedMixin): default='', blank=True) texto = models.TextField(verbose_name=_('Texto')) - url_externa = models.CharField( + url_externa = models.URLField( max_length=1024, blank=True, verbose_name=_('Url externa')) diff --git a/lexml/migrations/0004_auto_20160307_0918.py b/lexml/migrations/0004_auto_20160307_0918.py new file mode 100644 index 000000000..c6f31833e --- /dev/null +++ b/lexml/migrations/0004_auto_20160307_0918.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9 on 2016-03-07 12:18 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('lexml', '0003_auto_20160216_1015'), + ] + + operations = [ + migrations.AlterField( + model_name='lexmlprovedor', + name='email_responsavel', + field=models.EmailField(blank=True, max_length=50, verbose_name='E-mail do responsável'), + ), + migrations.AlterField( + model_name='lexmlpublicador', + name='email_responsavel', + field=models.EmailField(blank=True, max_length=50, verbose_name='E-mail do responsável'), + ), + ] diff --git a/lexml/models.py b/lexml/models.py index c147ee820..b931a5d17 100644 --- a/lexml/models.py +++ b/lexml/models.py @@ -6,7 +6,7 @@ class LexmlProvedor(models.Model): # LexmlRegistroProvedor id_provedor = models.PositiveIntegerField(verbose_name=_('Id do provedor')) nome = models.CharField(max_length=255, verbose_name=_('Nome do provedor')) sigla = models.CharField(max_length=15) - email_responsavel = models.CharField( + email_responsavel = models.EmailField( max_length=50, blank=True, verbose_name=_('E-mail do responsável')) @@ -34,7 +34,7 @@ class LexmlPublicador(models.Model): verbose_name=_('Id do publicador')) nome = models.CharField( max_length=255, verbose_name=_('Nome do publicador')) - email_responsavel = models.CharField( + email_responsavel = models.EmailField( max_length=50, blank=True, verbose_name=_('E-mail do responsável')) diff --git a/sessao/migrations/0015_auto_20160307_0918.py b/sessao/migrations/0015_auto_20160307_0918.py new file mode 100644 index 000000000..adc382bc7 --- /dev/null +++ b/sessao/migrations/0015_auto_20160307_0918.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9 on 2016-03-07 12:18 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('sessao', '0014_auto_20160223_0813'), + ] + + operations = [ + migrations.AlterField( + model_name='orador', + name='url_discurso', + field=models.URLField(blank=True, max_length=150, verbose_name='URL Vídeo'), + ), + migrations.AlterField( + model_name='oradorexpediente', + name='url_discurso', + field=models.URLField(blank=True, max_length=150, verbose_name='URL Vídeo'), + ), + migrations.AlterField( + model_name='sessaoplenaria', + name='url_audio', + field=models.URLField(blank=True, max_length=150, verbose_name='URL Arquivo Áudio (Formatos MP3 / AAC)'), + ), + migrations.AlterField( + model_name='sessaoplenaria', + name='url_video', + field=models.URLField(blank=True, max_length=150, verbose_name='URL Arquivo Vídeo (Formatos MP4 / FLV / WebM)'), + ), + ] diff --git a/sessao/models.py b/sessao/models.py index b3522c5af..e38e87f63 100644 --- a/sessao/models.py +++ b/sessao/models.py @@ -53,10 +53,10 @@ class SessaoPlenaria(models.Model): numero = models.PositiveIntegerField(verbose_name=_('Número')) data_fim = models.DateField( blank=True, null=True, verbose_name=_('Encerramento')) - url_audio = models.CharField( + url_audio = models.URLField( max_length=150, blank=True, verbose_name=_('URL Arquivo Áudio (Formatos MP3 / AAC)')) - url_video = models.CharField( + url_video = models.URLField( max_length=150, blank=True, verbose_name=_('URL Arquivo Vídeo (Formatos MP4 / FLV / WebM)')) upload_pauta = models.FileField( @@ -171,7 +171,7 @@ class AbstractOrador(models.Model): # Oradores parlamentar = models.ForeignKey(Parlamentar, verbose_name=_('Parlamentar')) numero_ordem = models.PositiveIntegerField( verbose_name=_('Ordem de pronunciamento')) - url_discurso = models.CharField( + url_discurso = models.URLField( max_length=150, blank=True, verbose_name=_('URL Vídeo')) class Meta: