Browse Source

add User custom para models Votante e VotoNominal

pull/919/head
LeandroRoberto 8 years ago
parent
commit
33169cb28a
  1. 7
      sapl/parlamentares/models.py
  2. 5
      sapl/sessao/models.py

7
sapl/parlamentares/models.py

@ -8,7 +8,8 @@ from model_utils import Choices
from sapl.base.models import Autor from sapl.base.models import Autor
from sapl.utils import (INDICADOR_AFASTAMENTO, UF, YES_NO_CHOICES, from sapl.utils import (INDICADOR_AFASTAMENTO, UF, YES_NO_CHOICES,
SaplGenericRelation, intervalos_tem_intersecao, SaplGenericRelation, intervalos_tem_intersecao,
restringe_tipos_de_arquivo_img) restringe_tipos_de_arquivo_img,
get_settings_auth_user_model)
class Legislatura(models.Model): class Legislatura(models.Model):
@ -501,7 +502,9 @@ class Frente(models.Model):
class Votante(models.Model): class Votante(models.Model):
parlamentar = models.ForeignKey( parlamentar = models.ForeignKey(
Parlamentar, verbose_name=_('Parlamentar'), related_name='parlamentar') Parlamentar, verbose_name=_('Parlamentar'), related_name='parlamentar')
user = models.ForeignKey(User, verbose_name=_('User'), related_name='user') user = models.ForeignKey(
get_settings_auth_user_model(),
verbose_name=_('User'), related_name='user')
data = models.DateTimeField( data = models.DateTimeField(
verbose_name=_('Data'), auto_now_add=True, verbose_name=_('Data'), auto_now_add=True,
max_length=30, null=True, blank=True) max_length=30, null=True, blank=True)

5
sapl/sessao/models.py

@ -8,7 +8,8 @@ from sapl.materia.models import MateriaLegislativa
from sapl.parlamentares.models import (CargoMesa, Legislatura, Parlamentar, from sapl.parlamentares.models import (CargoMesa, Legislatura, Parlamentar,
Partido, SessaoLegislativa) Partido, SessaoLegislativa)
from sapl.utils import (YES_NO_CHOICES, SaplGenericRelation, from sapl.utils import (YES_NO_CHOICES, SaplGenericRelation,
restringe_tipos_de_arquivo_txt, texto_upload_path) restringe_tipos_de_arquivo_txt, texto_upload_path,
get_settings_auth_user_model)
class CargoBancada(models.Model): class CargoBancada(models.Model):
@ -385,7 +386,7 @@ class VotoNominal(models.Model):
sessao = models.ForeignKey(SessaoPlenaria) sessao = models.ForeignKey(SessaoPlenaria)
materia = models.ForeignKey(MateriaLegislativa) materia = models.ForeignKey(MateriaLegislativa)
user = models.ForeignKey(User) user = models.ForeignKey(get_settings_auth_user_model())
ip = models.CharField(verbose_name=_('IP'), max_length=30) ip = models.CharField(verbose_name=_('IP'), max_length=30)
data_hora = models.DateTimeField( data_hora = models.DateTimeField(
verbose_name=_('Data/Hora'), auto_now_add=True) verbose_name=_('Data/Hora'), auto_now_add=True)

Loading…
Cancel
Save