|
@ -1,6 +1,7 @@ |
|
|
from django.db import models |
|
|
from django.db import models |
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_sessao_media_path(instance, subpath, filename): |
|
|
def get_sessao_media_path(instance, subpath, filename): |
|
|
return './casa/%s/%s/%s' % (instance.codigo, subpath, filename) |
|
|
return './casa/%s/%s/%s' % (instance.codigo, subpath, filename) |
|
|
|
|
|
|
|
@ -8,6 +9,7 @@ def get_sessao_media_path(instance, subpath, filename): |
|
|
def get_casa_media_path(instance, filename): |
|
|
def get_casa_media_path(instance, filename): |
|
|
return get_sessao_media_path(instance, 'Logotipo', filename) |
|
|
return get_sessao_media_path(instance, 'Logotipo', filename) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CasaLegislativa(models.Model): |
|
|
class CasaLegislativa(models.Model): |
|
|
# TODO ajustar todos os max_length !!!! |
|
|
# TODO ajustar todos os max_length !!!! |
|
|
# cod_casa => id (pk) |
|
|
# cod_casa => id (pk) |
|
@ -19,17 +21,24 @@ class CasaLegislativa(models.Model): |
|
|
cep = models.CharField(max_length=100, verbose_name=_('CEP')) |
|
|
cep = models.CharField(max_length=100, verbose_name=_('CEP')) |
|
|
municipio = models.CharField(max_length=100, verbose_name=_('Município')) |
|
|
municipio = models.CharField(max_length=100, verbose_name=_('Município')) |
|
|
uf = models.CharField(max_length=100, verbose_name=_('UF')) |
|
|
uf = models.CharField(max_length=100, verbose_name=_('UF')) |
|
|
telefone = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('Telefone')) |
|
|
telefone = models.CharField( |
|
|
fax = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('Fax')) |
|
|
max_length=100, blank=True, null=True, verbose_name=_('Telefone')) |
|
|
|
|
|
fax = models.CharField( |
|
|
|
|
|
max_length=100, blank=True, null=True, verbose_name=_('Fax')) |
|
|
logotipo = models.ImageField( |
|
|
logotipo = models.ImageField( |
|
|
blank=True, |
|
|
blank=True, |
|
|
null=True, |
|
|
null=True, |
|
|
upload_to=get_casa_media_path, |
|
|
upload_to=get_casa_media_path, |
|
|
verbose_name=_('Logotipo')) |
|
|
verbose_name=_('Logotipo')) |
|
|
endereco_web = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('HomePage')) |
|
|
endereco_web = models.CharField( |
|
|
email = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('E-mail')) |
|
|
max_length=100, blank=True, null=True, verbose_name=_('HomePage')) |
|
|
|
|
|
email = models.CharField( |
|
|
|
|
|
max_length=100, blank=True, null=True, verbose_name=_('E-mail')) |
|
|
informacao_geral = models.CharField( |
|
|
informacao_geral = models.CharField( |
|
|
max_length=100, blank=True, null=True, verbose_name=_('Informação Geral')) |
|
|
max_length=100, |
|
|
|
|
|
blank=True, |
|
|
|
|
|
null=True, |
|
|
|
|
|
verbose_name=_('Informação Geral')) |
|
|
|
|
|
|
|
|
class Meta: |
|
|
class Meta: |
|
|
verbose_name = _('Casa Legislativa') |
|
|
verbose_name = _('Casa Legislativa') |
|
|