|
@ -1,18 +1,21 @@ |
|
|
from django.db import models |
|
|
from django.db import models |
|
|
|
|
|
|
|
|
|
|
|
from comissoes.models import Comissao |
|
|
|
|
|
from norma.models import NormaJuridica |
|
|
from parlamentares.models import Parlamentar |
|
|
from parlamentares.models import Parlamentar |
|
|
|
|
|
from parlamentares.models import Partido |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AcompMateria(models.Model): |
|
|
class AcompMateria(models.Model): |
|
|
cod_cadastro = models.AutoField(primary_key=True) |
|
|
cod_cadastro = models.AutoField(primary_key=True) |
|
|
cod_materia = models.IntegerField() |
|
|
materia = models.ForeignKey(MateriaLegislativa) |
|
|
end_email = models.CharField(max_length=100) |
|
|
end_email = models.CharField(max_length=100) |
|
|
txt_hash = models.CharField(max_length=8) |
|
|
txt_hash = models.CharField(max_length=8) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Anexada(models.Model): |
|
|
class Anexada(models.Model): |
|
|
cod_materia_principal = models.IntegerField() |
|
|
materia_principal = models.ForeignKey(MateriaLegislativa) |
|
|
cod_materia_anexada = models.IntegerField() |
|
|
materia_anexada = models.ForeignKey(MateriaLegislativa) |
|
|
dat_anexacao = models.DateField() |
|
|
dat_anexacao = models.DateField() |
|
|
dat_desanexacao = models.DateField(blank=True, null=True) |
|
|
dat_desanexacao = models.DateField(blank=True, null=True) |
|
|
|
|
|
|
|
@ -25,31 +28,31 @@ class AssuntoMateria(models.Model): |
|
|
|
|
|
|
|
|
class Autor(models.Model): |
|
|
class Autor(models.Model): |
|
|
cod_autor = models.AutoField(primary_key=True) |
|
|
cod_autor = models.AutoField(primary_key=True) |
|
|
cod_partido = models.IntegerField(blank=True, null=True) |
|
|
partido = models.ForeignKey(Partido, blank=True, null=True) |
|
|
cod_comissao = models.IntegerField(blank=True, null=True) |
|
|
comissao = models.ForeignKey(Comissao, blank=True, null=True) |
|
|
parlamentar = models.ForeignKey(Parlamentar, blank=True, null=True) |
|
|
parlamentar = models.ForeignKey(Parlamentar, blank=True, null=True) |
|
|
tip_autor = models.IntegerField() |
|
|
tip_autor = models.ForeignKey(TipoAutor) |
|
|
nom_autor = models.CharField(max_length=50, blank=True, null=True) |
|
|
nom_autor = models.CharField(max_length=50, blank=True, null=True) |
|
|
des_cargo = models.CharField(max_length=50, blank=True, null=True) |
|
|
des_cargo = models.CharField(max_length=50, blank=True, null=True) |
|
|
col_username = models.CharField(max_length=50, blank=True, null=True) |
|
|
col_username = models.CharField(max_length=50, blank=True, null=True) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Autoria(models.Model): |
|
|
class Autoria(models.Model): |
|
|
cod_autor = models.IntegerField() |
|
|
autor = models.ForeignKey(Autor) |
|
|
cod_materia = models.IntegerField() |
|
|
materia = models.ForeignKey(MateriaLegislativa) |
|
|
ind_primeiro_autor = models.IntegerField() |
|
|
ind_primeiro_autor = models.IntegerField() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DespachoInicial(models.Model): |
|
|
class DespachoInicial(models.Model): |
|
|
cod_materia = models.IntegerField() |
|
|
materia = models.ForeignKey(MateriaLegislativa) |
|
|
num_ordem = models.IntegerField() |
|
|
num_ordem = models.IntegerField() |
|
|
cod_comissao = models.IntegerField() |
|
|
comissao = models.ForeignKey(Comissao) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DocumentoAcessorio(models.Model): |
|
|
class DocumentoAcessorio(models.Model): |
|
|
cod_documento = models.AutoField(primary_key=True) |
|
|
cod_documento = models.AutoField(primary_key=True) |
|
|
cod_materia = models.IntegerField() |
|
|
materia = models.ForeignKey(MateriaLegislativa) |
|
|
tip_documento = models.IntegerField() |
|
|
tip_documento = models.ForeignKey(TipoDocumento) |
|
|
nom_documento = models.CharField(max_length=30) |
|
|
nom_documento = models.CharField(max_length=30) |
|
|
dat_documento = models.DateField(blank=True, null=True) |
|
|
dat_documento = models.DateField(blank=True, null=True) |
|
|
nom_autor_documento = models.CharField(max_length=50, blank=True, null=True) |
|
|
nom_autor_documento = models.CharField(max_length=50, blank=True, null=True) |
|
@ -58,8 +61,8 @@ class DocumentoAcessorio(models.Model): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LegislacaoCitada(models.Model): |
|
|
class LegislacaoCitada(models.Model): |
|
|
cod_materia = models.IntegerField() |
|
|
materia = models.ForeignKey(MateriaLegislativa) |
|
|
cod_norma = models.IntegerField() |
|
|
norma = models.ForeignKey(NormaJuridica) |
|
|
des_disposicoes = models.CharField(max_length=15, blank=True, null=True) |
|
|
des_disposicoes = models.CharField(max_length=15, blank=True, null=True) |
|
|
des_parte = models.CharField(max_length=8, blank=True, null=True) |
|
|
des_parte = models.CharField(max_length=8, blank=True, null=True) |
|
|
des_livro = models.CharField(max_length=7, blank=True, null=True) |
|
|
des_livro = models.CharField(max_length=7, blank=True, null=True) |
|
@ -75,25 +78,25 @@ class LegislacaoCitada(models.Model): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MateriaAssunto(models.Model): |
|
|
class MateriaAssunto(models.Model): |
|
|
cod_assunto = models.IntegerField() |
|
|
assunto = models.ForeignKey(AssuntoMateria) |
|
|
cod_materia = models.IntegerField() |
|
|
materia = models.ForeignKey(MateriaLegislativa) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MateriaLegislativa(models.Model): |
|
|
class MateriaLegislativa(models.Model): |
|
|
cod_materia = models.AutoField(primary_key=True) |
|
|
cod_materia = models.AutoField(primary_key=True) |
|
|
tip_id_basica = models.IntegerField() |
|
|
tip_id_basica = models.ForeignKey(TipoMateriaLegislativa) |
|
|
num_protocolo = models.IntegerField(blank=True, null=True) |
|
|
num_protocolo = models.IntegerField(blank=True, null=True) |
|
|
num_ident_basica = models.IntegerField() |
|
|
num_ident_basica = models.IntegerField() |
|
|
ano_ident_basica = models.SmallIntegerField() |
|
|
ano_ident_basica = models.SmallIntegerField() |
|
|
dat_apresentacao = models.DateField(blank=True, null=True) |
|
|
dat_apresentacao = models.DateField(blank=True, null=True) |
|
|
tip_apresentacao = models.CharField(max_length=1, blank=True, null=True) |
|
|
tip_apresentacao = models.CharField(max_length=1, blank=True, null=True) |
|
|
cod_regime_tramitacao = models.IntegerField() |
|
|
regime_tramitacao = models.ForeignKey(RegimeTramitacao) |
|
|
dat_publicacao = models.DateField(blank=True, null=True) |
|
|
dat_publicacao = models.DateField(blank=True, null=True) |
|
|
tip_origem_externa = models.IntegerField(blank=True, null=True) |
|
|
tip_origem_externa = models.ForeignKey(TipoMateriaLegislativa, blank=True, null=True) |
|
|
num_origem_externa = models.CharField(max_length=5, blank=True, null=True) |
|
|
num_origem_externa = models.CharField(max_length=5, blank=True, null=True) |
|
|
ano_origem_externa = models.SmallIntegerField(blank=True, null=True) |
|
|
ano_origem_externa = models.SmallIntegerField(blank=True, null=True) |
|
|
dat_origem_externa = models.DateField(blank=True, null=True) |
|
|
dat_origem_externa = models.DateField(blank=True, null=True) |
|
|
cod_local_origem_externa = models.IntegerField(blank=True, null=True) |
|
|
local_origem_externa = models.ForeignKey(Origem, blank=True, null=True) |
|
|
nom_apelido = models.CharField(max_length=50, blank=True, null=True) |
|
|
nom_apelido = models.CharField(max_length=50, blank=True, null=True) |
|
|
num_dias_prazo = models.IntegerField(blank=True, null=True) |
|
|
num_dias_prazo = models.IntegerField(blank=True, null=True) |
|
|
dat_fim_prazo = models.DateField(blank=True, null=True) |
|
|
dat_fim_prazo = models.DateField(blank=True, null=True) |
|
@ -109,9 +112,9 @@ class MateriaLegislativa(models.Model): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Numeracao(models.Model): |
|
|
class Numeracao(models.Model): |
|
|
cod_materia = models.IntegerField() |
|
|
materia = models.ForeignKey(MateriaLegislativa) |
|
|
num_ordem = models.IntegerField() |
|
|
num_ordem = models.IntegerField() |
|
|
tip_materia = models.IntegerField() |
|
|
tip_materia = models.ForeignKey(TipoMateriaLegislativa) |
|
|
num_materia = models.CharField(max_length=5) |
|
|
num_materia = models.CharField(max_length=5) |
|
|
ano_materia = models.SmallIntegerField() |
|
|
ano_materia = models.SmallIntegerField() |
|
|
dat_materia = models.DateField(blank=True, null=True) |
|
|
dat_materia = models.DateField(blank=True, null=True) |
|
@ -133,8 +136,8 @@ class Origem(models.Model): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Parecer(models.Model): |
|
|
class Parecer(models.Model): |
|
|
cod_relatoria = models.IntegerField() |
|
|
relatoria = models.ForeignKey(Relatoria) |
|
|
cod_materia = models.IntegerField() |
|
|
materia = models.ForeignKey(MateriaLegislativa) |
|
|
tip_conclusao = models.CharField(max_length=3, blank=True, null=True) |
|
|
tip_conclusao = models.CharField(max_length=3, blank=True, null=True) |
|
|
tip_apresentacao = models.CharField(max_length=1) |
|
|
tip_apresentacao = models.CharField(max_length=1) |
|
|
txt_parecer = models.TextField(blank=True, null=True) |
|
|
txt_parecer = models.TextField(blank=True, null=True) |
|
@ -142,9 +145,9 @@ class Parecer(models.Model): |
|
|
|
|
|
|
|
|
class Proposicao(models.Model): |
|
|
class Proposicao(models.Model): |
|
|
cod_proposicao = models.AutoField(primary_key=True) |
|
|
cod_proposicao = models.AutoField(primary_key=True) |
|
|
cod_materia = models.IntegerField(blank=True, null=True) |
|
|
materia = models.ForeignKey(MateriaLegislativa, blank=True, null=True) |
|
|
cod_autor = models.IntegerField() |
|
|
autor = models.ForeignKey(Autor) |
|
|
tip_proposicao = models.IntegerField() |
|
|
tip_proposicao = models.ForeignKey(TipoProposicao) |
|
|
dat_envio = models.DateTimeField() |
|
|
dat_envio = models.DateTimeField() |
|
|
dat_recebimento = models.DateTimeField(blank=True, null=True) |
|
|
dat_recebimento = models.DateTimeField(blank=True, null=True) |
|
|
txt_descricao = models.CharField(max_length=100) |
|
|
txt_descricao = models.CharField(max_length=100) |
|
@ -161,10 +164,10 @@ class RegimeTramitacao(models.Model): |
|
|
|
|
|
|
|
|
class Relatoria(models.Model): |
|
|
class Relatoria(models.Model): |
|
|
cod_relatoria = models.AutoField(primary_key=True) |
|
|
cod_relatoria = models.AutoField(primary_key=True) |
|
|
cod_materia = models.IntegerField() |
|
|
materia = models.ForeignKey(MateriaLegislativa) |
|
|
parlamentar = models.ForeignKey(Parlamentar) |
|
|
parlamentar = models.ForeignKey(Parlamentar) |
|
|
tip_fim_relatoria = models.IntegerField(blank=True, null=True) |
|
|
tip_fim_relatoria = models.ForeignKey(TipoFimRelatoria, blank=True, null=True) |
|
|
cod_comissao = models.IntegerField(blank=True, null=True) |
|
|
comissao = models.ForeignKey(Comissao, blank=True, null=True) |
|
|
dat_desig_relator = models.DateField() |
|
|
dat_desig_relator = models.DateField() |
|
|
dat_destit_relator = models.DateField(blank=True, null=True) |
|
|
dat_destit_relator = models.DateField(blank=True, null=True) |
|
|
|
|
|
|
|
@ -210,12 +213,12 @@ class TipoProposicao(models.Model): |
|
|
|
|
|
|
|
|
class Tramitacao(models.Model): |
|
|
class Tramitacao(models.Model): |
|
|
cod_tramitacao = models.AutoField(primary_key=True) |
|
|
cod_tramitacao = models.AutoField(primary_key=True) |
|
|
cod_status = models.IntegerField(blank=True, null=True) |
|
|
status = models.ForeignKey(StatusTramitacao, blank=True, null=True) |
|
|
cod_materia = models.IntegerField() |
|
|
materia = models.ForeignKey(MateriaLegislativa) |
|
|
dat_tramitacao = models.DateField(blank=True, null=True) |
|
|
dat_tramitacao = models.DateField(blank=True, null=True) |
|
|
cod_unid_tram_local = models.IntegerField(blank=True, null=True) |
|
|
unid_tram_local = models.ForeignKey(UnidadeTramitacao, blank=True, null=True) |
|
|
dat_encaminha = models.DateField(blank=True, null=True) |
|
|
dat_encaminha = models.DateField(blank=True, null=True) |
|
|
cod_unid_tram_dest = models.IntegerField(blank=True, null=True) |
|
|
unid_tram_dest = models.ForeignKey(UnidadeTramitacao, blank=True, null=True) |
|
|
ind_ult_tramitacao = models.IntegerField() |
|
|
ind_ult_tramitacao = models.IntegerField() |
|
|
ind_urgencia = models.IntegerField() |
|
|
ind_urgencia = models.IntegerField() |
|
|
sgl_turno = models.CharField(max_length=1, blank=True, null=True) |
|
|
sgl_turno = models.CharField(max_length=1, blank=True, null=True) |
|
@ -225,6 +228,7 @@ class Tramitacao(models.Model): |
|
|
|
|
|
|
|
|
class UnidadeTramitacao(models.Model): |
|
|
class UnidadeTramitacao(models.Model): |
|
|
cod_unid_tramitacao = models.AutoField(primary_key=True) |
|
|
cod_unid_tramitacao = models.AutoField(primary_key=True) |
|
|
cod_comissao = models.IntegerField(blank=True, null=True) |
|
|
comissao = models.ForeignKey(Comissao, blank=True, null=True) |
|
|
cod_orgao = models.IntegerField(blank=True, null=True) |
|
|
orgao = models.ForeignKey(Orgao, blank=True, null=True) |
|
|
parlamentar = models.ForeignKey(Parlamentar, blank=True, null=True) |
|
|
parlamentar = models.ForeignKey(Parlamentar, blank=True, null=True) |
|
|
|
|
|
|
|
|