|
|
@ -1,6 +1,7 @@ |
|
|
|
from django.db import models |
|
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
|
|
|
|
|
|
|
|
|
def get_sessao_media_path(instance, 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): |
|
|
|
return get_sessao_media_path(instance, 'Logotipo', filename) |
|
|
|
|
|
|
|
|
|
|
|
class CasaLegislativa(models.Model): |
|
|
|
# TODO ajustar todos os max_length !!!! |
|
|
|
# cod_casa => id (pk) |
|
|
@ -19,17 +21,24 @@ class CasaLegislativa(models.Model): |
|
|
|
cep = models.CharField(max_length=100, verbose_name=_('CEP')) |
|
|
|
municipio = models.CharField(max_length=100, verbose_name=_('Município')) |
|
|
|
uf = models.CharField(max_length=100, verbose_name=_('UF')) |
|
|
|
telefone = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('Telefone')) |
|
|
|
fax = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('Fax')) |
|
|
|
telefone = models.CharField( |
|
|
|
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( |
|
|
|
blank=True, |
|
|
|
null=True, |
|
|
|
upload_to=get_casa_media_path, |
|
|
|
verbose_name=_('Logotipo')) |
|
|
|
endereco_web = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('HomePage')) |
|
|
|
email = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('E-mail')) |
|
|
|
endereco_web = models.CharField( |
|
|
|
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( |
|
|
|
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: |
|
|
|
verbose_name = _('Casa Legislativa') |
|
|
|