mirror of https://github.com/interlegis/sapl.git
Marcio Mazza
6 years ago
396 changed files with 21321 additions and 8040 deletions
@ -0,0 +1,4 @@ |
|||
media |
|||
collected_static |
|||
.git |
|||
whoosh |
@ -0,0 +1,18 @@ |
|||
#!/bin/bash |
|||
|
|||
# Pass the base SOLR URL as parameter, i.e., bash check_solr http://localhost:8983 |
|||
|
|||
SOLR_URL=$1 |
|||
|
|||
echo "Waiting for solr connection at $SOLR_URL ..." |
|||
while true; do |
|||
echo "$SOLR_URL/solr/admin/collections?action=LIST" |
|||
RESULT=$(curl -s -o /dev/null -I "$SOLR_URL/solr/admin/collections?action=LIST" -w '%{http_code}') |
|||
echo $RESULT |
|||
if [ "$RESULT" -eq '200' ]; then |
|||
echo "Solr server is up!" |
|||
break |
|||
else |
|||
sleep 3 |
|||
fi |
|||
done |
@ -1,36 +1,36 @@ |
|||
dj-database-url==0.4.1 |
|||
django-haystack==2.6.0 |
|||
django>=1.10,<1.11 |
|||
git+git://github.com/rubgombar1/django-admin-bootstrapped.git |
|||
django-bootstrap3==7.0.1 |
|||
django-bower==5.2.0 |
|||
django>=1.11.19,<2.0 |
|||
django-haystack==2.8.1 |
|||
django-filter==2.0.0 |
|||
djangorestframework==3.9.0 |
|||
dj-database-url==0.5.0 |
|||
django-braces==1.9.0 |
|||
django-compressor==2.0 |
|||
django-crispy-forms==1.6.1 |
|||
django-extensions==1.9.8 |
|||
django-extra-views==0.11.0 |
|||
django-filter==0.15.3 |
|||
django-floppyforms==1.6.2 |
|||
django-model-utils==3.1.1 |
|||
django-sass-processor==0.5.8 |
|||
djangorestframework==3.4.0 |
|||
git+git://github.com/jasperlittle/django-rest-framework-docs |
|||
easy-thumbnails==2.5 |
|||
django-crispy-forms==1.7.2 |
|||
django-floppyforms==1.7.0 |
|||
django-extra-views==0.12.0 |
|||
django-model-utils==3.1.2 |
|||
django-reversion==3.0.2 |
|||
django-reversion-compare==0.8.6 |
|||
django-speedinfo==1.4.0 |
|||
django-extensions==2.1.4 |
|||
django-image-cropping==1.2 |
|||
git+git://github.com/interlegis/trml2pdf.git |
|||
libsass==0.11.1 |
|||
psycopg2-binary==2.7.4 |
|||
python-decouple==3.0 |
|||
pytz==2016.4 |
|||
pyyaml==3.11 |
|||
rtyaml==0.0.3 |
|||
textract==1.5.0 |
|||
django-webpack-loader==0.6.0 |
|||
drf-yasg==1.13.0 |
|||
easy-thumbnails==2.5 |
|||
python-decouple==3.1 |
|||
psycopg2-binary==2.7.6.1 |
|||
pyyaml==4.2b1 |
|||
pytz==2018.9 |
|||
rtyaml==0.0.5 |
|||
python-magic==0.4.15 |
|||
unipath==1.1 |
|||
WeasyPrint==44 |
|||
gunicorn==19.9.0 |
|||
|
|||
textract==1.5.0 |
|||
pysolr==3.6.0 |
|||
python-magic==0.4.12 |
|||
gunicorn==19.6.0 |
|||
django-reversion==2.0.8 |
|||
WeasyPrint==0.42 |
|||
whoosh==2.7.4 |
|||
django-speedinfo==1.3.5 |
|||
django-reversion-compare==0.8.4 |
|||
|
|||
pyoai==2.5.0 |
|||
|
|||
git+git://github.com/interlegis/trml2pdf.git |
|||
git+git://github.com/interlegis/django-admin-bootstrapped |
|||
|
@ -0,0 +1,670 @@ |
|||
|
|||
import logging |
|||
import logging |
|||
|
|||
from django.contrib.contenttypes.models import ContentType |
|||
from django.db.models import Q |
|||
from django.db.models import Q |
|||
from django.forms.fields import CharField, MultiValueField |
|||
from django.forms.widgets import MultiWidget, TextInput |
|||
from django.http import Http404 |
|||
from django.utils import timezone |
|||
from django.utils.translation import ugettext_lazy as _ |
|||
from django.utils.translation import ugettext_lazy as _ |
|||
from django_filters.filters import CharFilter, ModelChoiceFilter, DateFilter |
|||
from django_filters.rest_framework.backends import DjangoFilterBackend |
|||
from django_filters.rest_framework.filterset import FilterSet |
|||
from rest_framework import serializers |
|||
from rest_framework import serializers |
|||
from rest_framework.generics import ListAPIView |
|||
from rest_framework.mixins import ListModelMixin, RetrieveModelMixin |
|||
from rest_framework.permissions import (IsAuthenticated, |
|||
IsAuthenticatedOrReadOnly, AllowAny) |
|||
from rest_framework.viewsets import GenericViewSet |
|||
|
|||
from sapl.api.serializers import ModelChoiceSerializer, AutorSerializer,\ |
|||
ChoiceSerializer |
|||
from sapl.base.models import TipoAutor, Autor, CasaLegislativa |
|||
from sapl.materia.models import MateriaLegislativa |
|||
from sapl.parlamentares.models import Legislatura |
|||
from sapl.sessao.models import SessaoPlenaria, OrdemDia |
|||
from sapl.utils import SaplGenericRelation |
|||
from sapl.utils import generic_relations_for_model |
|||
|
|||
|
|||
class SaplGenericRelationSearchFilterSet(FilterSet): |
|||
q = CharFilter(method='filter_q') |
|||
|
|||
def filter_q(self, queryset, name, value): |
|||
|
|||
query = value.split(' ') |
|||
if query: |
|||
q = Q() |
|||
for qtext in query: |
|||
if not qtext: |
|||
continue |
|||
q_fs = Q(nome__icontains=qtext) |
|||
|
|||
order_by = [] |
|||
|
|||
for gr in generic_relations_for_model(self._meta.model): |
|||
sgr = gr[1] |
|||
for item in sgr: |
|||
if item.related_model != self._meta.model: |
|||
|
|||
continue |
|||
flag_order_by = True |
|||
for field in item.fields_search: |
|||
if flag_order_by: |
|||
flag_order_by = False |
|||
order_by.append('%s__%s' % ( |
|||
item.related_query_name(), |
|||
field[0]) |
|||
) |
|||
# if len(field) == 3 and field[2](qtext) is not |
|||
# None: |
|||
q_fs = q_fs | Q(**{'%s__%s%s' % ( |
|||
item.related_query_name(), |
|||
field[0], |
|||
field[1]): qtext if len(field) == 2 |
|||
else field[2](qtext)}) |
|||
|
|||
q = q & q_fs |
|||
|
|||
if q: |
|||
queryset = queryset.filter(q).order_by(*order_by) |
|||
|
|||
return queryset |
|||
|
|||
|
|||
class SearchForFieldWidget(MultiWidget): |
|||
|
|||
def decompress(self, value): |
|||
if value is None: |
|||
return [None, None] |
|||
return value |
|||
|
|||
def __init__(self, attrs=None): |
|||
widgets = (TextInput, TextInput) |
|||
MultiWidget.__init__(self, widgets, attrs) |
|||
|
|||
|
|||
class SearchForFieldField(MultiValueField): |
|||
widget = SearchForFieldWidget |
|||
|
|||
def __init__(self, *args, **kwargs): |
|||
fields = ( |
|||
CharField(), |
|||
CharField()) |
|||
super(SearchForFieldField, self).__init__(fields, *args, **kwargs) |
|||
|
|||
def compress(self, parameters): |
|||
if parameters: |
|||
return parameters |
|||
return None |
|||
|
|||
|
|||
class SearchForFieldFilter(CharFilter): |
|||
field_class = SearchForFieldField |
|||
|
|||
|
|||
class AutorChoiceFilterSet(SaplGenericRelationSearchFilterSet): |
|||
q = CharFilter(method='filter_q') |
|||
tipo = ModelChoiceFilter(queryset=TipoAutor.objects.all()) |
|||
|
|||
class Meta: |
|||
model = Autor |
|||
fields = ['q', |
|||
'tipo', |
|||
'nome', ] |
|||
|
|||
def filter_q(self, queryset, name, value): |
|||
return super().filter_q( |
|||
queryset, name, value).distinct('nome').order_by('nome') |
|||
|
|||
|
|||
class AutorSearchForFieldFilterSet(AutorChoiceFilterSet): |
|||
q = SearchForFieldFilter(method='filter_q') |
|||
|
|||
class Meta(AutorChoiceFilterSet.Meta): |
|||
pass |
|||
|
|||
def filter_q(self, queryset, name, value): |
|||
|
|||
value[0] = value[0].split(',') |
|||
value[1] = value[1].split(',') |
|||
|
|||
params = {} |
|||
for key, v in list(zip(value[0], value[1])): |
|||
if v in ['True', 'False']: |
|||
v = '1' if v == 'True' else '0' |
|||
params[key] = v |
|||
return queryset.filter(**params).distinct('nome').order_by('nome') |
|||
|
|||
|
|||
class AutoresPossiveisFilterSet(FilterSet): |
|||
logger = logging.getLogger(__name__) |
|||
data_relativa = DateFilter(method='filter_data_relativa') |
|||
tipo = CharFilter(method='filter_tipo') |
|||
|
|||
class Meta: |
|||
model = Autor |
|||
fields = ['data_relativa', 'tipo', ] |
|||
|
|||
def filter_data_relativa(self, queryset, name, value): |
|||
return queryset |
|||
|
|||
def filter_tipo(self, queryset, name, value): |
|||
|
|||
try: |
|||
self.logger.debug( |
|||
"Tentando obter TipoAutor correspondente à pk {}.".format(value)) |
|||
tipo = TipoAutor.objects.get(pk=value) |
|||
except: |
|||
self.logger.error("TipoAutor(pk={}) inexistente.".format(value)) |
|||
raise serializers.ValidationError(_('Tipo de Autor inexistente.')) |
|||
|
|||
qs = queryset.filter(tipo=tipo) |
|||
|
|||
return qs |
|||
|
|||
@property |
|||
def qs(self): |
|||
qs = super().qs |
|||
|
|||
data_relativa = self.form.cleaned_data['data_relativa'] \ |
|||
if 'data_relativa' in self.form.cleaned_data else None |
|||
|
|||
tipo = self.form.cleaned_data['tipo'] \ |
|||
if 'tipo' in self.form.cleaned_data else None |
|||
|
|||
if not tipo: |
|||
return qs |
|||
|
|||
tipo = TipoAutor.objects.get(pk=tipo) |
|||
if not tipo.content_type: |
|||
return qs |
|||
|
|||
filter_for_model = 'filter_%s' % tipo.content_type.model |
|||
|
|||
if not hasattr(self, filter_for_model): |
|||
return qs |
|||
|
|||
if not data_relativa: |
|||
data_relativa = timezone.now() |
|||
|
|||
return getattr(self, filter_for_model)(qs, data_relativa).distinct() |
|||
|
|||
def filter_parlamentar(self, queryset, data_relativa): |
|||
# não leva em conta afastamentos |
|||
legislatura_relativa = Legislatura.objects.filter( |
|||
data_inicio__lte=data_relativa, |
|||
data_fim__gte=data_relativa).first() |
|||
|
|||
q = Q( |
|||
parlamentar_set__mandato__data_inicio_mandato__lte=data_relativa, |
|||
parlamentar_set__mandato__data_fim_mandato__isnull=True) | Q( |
|||
parlamentar_set__mandato__data_inicio_mandato__lte=data_relativa, |
|||
parlamentar_set__mandato__data_fim_mandato__gte=data_relativa) |
|||
|
|||
if legislatura_relativa.atual(): |
|||
q = q & Q(parlamentar_set__ativo=True) |
|||
|
|||
return queryset.filter(q) |
|||
|
|||
def filter_comissao(self, queryset, data_relativa): |
|||
return queryset.filter( |
|||
Q(comissao_set__data_extincao__isnull=True, |
|||
comissao_set__data_fim_comissao__isnull=True) | |
|||
Q(comissao_set__data_extincao__gte=data_relativa, |
|||
comissao_set__data_fim_comissao__isnull=True) | |
|||
Q(comissao_set__data_extincao__gte=data_relativa, |
|||
comissao_set__data_fim_comissao__isnull=True) | |
|||
Q(comissao_set__data_extincao__isnull=True, |
|||
comissao_set__data_fim_comissao__gte=data_relativa) | |
|||
Q(comissao_set__data_extincao__gte=data_relativa, |
|||
comissao_set__data_fim_comissao__gte=data_relativa), |
|||
comissao_set__data_criacao__lte=data_relativa) |
|||
|
|||
def filter_frente(self, queryset, data_relativa): |
|||
return queryset.filter( |
|||
Q(frente_set__data_extincao__isnull=True) | |
|||
Q(frente_set__data_extincao__gte=data_relativa), |
|||
frente_set__data_criacao__lte=data_relativa) |
|||
|
|||
def filter_bancada(self, queryset, data_relativa): |
|||
return queryset.filter( |
|||
Q(bancada_set__data_extincao__isnull=True) | |
|||
Q(bancada_set__data_extincao__gte=data_relativa), |
|||
bancada_set__data_criacao__lte=data_relativa) |
|||
|
|||
def filter_bloco(self, queryset, data_relativa): |
|||
return queryset.filter( |
|||
Q(bloco_set__data_extincao__isnull=True) | |
|||
Q(bloco_set__data_extincao__gte=data_relativa), |
|||
bloco_set__data_criacao__lte=data_relativa) |
|||
|
|||
def filter_orgao(self, queryset, data_relativa): |
|||
# na implementação, não havia regras a implementar para orgao |
|||
return queryset |
|||
|
|||
|
|||
class AutorChoiceSerializer(ModelChoiceSerializer): |
|||
|
|||
def get_text(self, obj): |
|||
return obj.nome |
|||
|
|||
class Meta: |
|||
model = Autor |
|||
fields = ['id', 'nome'] |
|||
|
|||
|
|||
class MateriaLegislativaOldSerializer(serializers.ModelSerializer): |
|||
|
|||
class Meta: |
|||
model = MateriaLegislativa |
|||
fields = '__all__' |
|||
|
|||
|
|||
class SessaoPlenariaOldSerializer(serializers.ModelSerializer): |
|||
|
|||
codReuniao = serializers.SerializerMethodField('get_pk_sessao') |
|||
codReuniaoPrincipal = serializers.SerializerMethodField('get_pk_sessao') |
|||
txtTituloReuniao = serializers.SerializerMethodField('get_name') |
|||
txtSiglaOrgao = serializers.SerializerMethodField('get_sigla_orgao') |
|||
txtApelido = serializers.SerializerMethodField('get_name') |
|||
txtNomeOrgao = serializers.SerializerMethodField('get_nome_orgao') |
|||
codEstadoReuniao = serializers.SerializerMethodField( |
|||
'get_estadoSessaoPlenaria') |
|||
txtTipoReuniao = serializers.SerializerMethodField('get_tipo_sessao') |
|||
txtObjeto = serializers.SerializerMethodField('get_assunto_sessao') |
|||
txtLocal = serializers.SerializerMethodField('get_endereco_orgao') |
|||
bolReuniaoConjunta = serializers.SerializerMethodField( |
|||
'get_reuniao_conjunta') |
|||
bolHabilitarEventoInterativo = serializers.SerializerMethodField( |
|||
'get_iterativo') |
|||
idYoutube = serializers.SerializerMethodField('get_url') |
|||
codEstadoTransmissaoYoutube = serializers.SerializerMethodField( |
|||
'get_estadoTransmissaoYoutube') |
|||
datReuniaoString = serializers.SerializerMethodField('get_date') |
|||
|
|||
# Constantes SessaoPlenaria (de 1-9) (apenas 3 serão usados) |
|||
SESSAO_FINALIZADA = 4 |
|||
SESSAO_EM_ANDAMENTO = 3 |
|||
SESSAO_CONVOCADA = 2 |
|||
|
|||
# Constantes EstadoTranmissaoYoutube (de 0 a 2) |
|||
TRANSMISSAO_ENCERRADA = 2 |
|||
TRANSMISSAO_EM_ANDAMENTO = 1 |
|||
SEM_TRANSMISSAO = 0 |
|||
|
|||
class Meta: |
|||
model = SessaoPlenaria |
|||
fields = ( |
|||
'codReuniao', |
|||
'codReuniaoPrincipal', |
|||
'txtTituloReuniao', |
|||
'txtSiglaOrgao', |
|||
'txtApelido', |
|||
'txtNomeOrgao', |
|||
'codEstadoReuniao', |
|||
'txtTipoReuniao', |
|||
'txtObjeto', |
|||
'txtLocal', |
|||
'bolReuniaoConjunta', |
|||
'bolHabilitarEventoInterativo', |
|||
'idYoutube', |
|||
'codEstadoTransmissaoYoutube', |
|||
'datReuniaoString' |
|||
) |
|||
|
|||
def __init__(self, *args, **kwargs): |
|||
super(SessaoPlenariaOldSerializer, self).__init__(args, kwargs) |
|||
|
|||
def get_pk_sessao(self, obj): |
|||
return obj.pk |
|||
|
|||
def get_name(self, obj): |
|||
return obj.__str__() |
|||
|
|||
def get_estadoSessaoPlenaria(self, obj): |
|||
if obj.finalizada: |
|||
return self.SESSAO_FINALIZADA |
|||
elif obj.iniciada: |
|||
return self.SESSAO_EM_ANDAMENTO |
|||
else: |
|||
return self.SESSAO_CONVOCADA |
|||
|
|||
def get_tipo_sessao(self, obj): |
|||
return obj.tipo.__str__() |
|||
|
|||
def get_url(self, obj): |
|||
return obj.url_video if obj.url_video else None |
|||
|
|||
def get_iterativo(self, obj): |
|||
return obj.interativa if obj.interativa else False |
|||
|
|||
def get_date(self, obj): |
|||
return "{} {}{}".format( |
|||
obj.data_inicio.strftime("%d/%m/%Y"), |
|||
obj.hora_inicio, |
|||
":00" |
|||
) |
|||
|
|||
def get_estadoTransmissaoYoutube(self, obj): |
|||
if obj.url_video: |
|||
if obj.finalizada: |
|||
return self.TRANSMISSAO_ENCERRADA |
|||
else: |
|||
return self.TRANSMISSAO_EM_ANDAMENTO |
|||
else: |
|||
return self.SEM_TRANSMISSAO |
|||
|
|||
def get_assunto_sessao(self, obj): |
|||
pauta_sessao = '' |
|||
ordem_dia = OrdemDia.objects.filter(sessao_plenaria=obj.pk) |
|||
pauta_sessao = ', '.join([i.materia.__str__() for i in ordem_dia]) |
|||
|
|||
return str(pauta_sessao) |
|||
|
|||
def get_endereco_orgao(self, obj): |
|||
return self.casa().endereco |
|||
|
|||
def get_reuniao_conjunta(self, obj): |
|||
return False |
|||
|
|||
def get_sigla_orgao(self, obj): |
|||
return self.casa().sigla |
|||
|
|||
def get_nome_orgao(self, obj): |
|||
return self.casa().nome |
|||
|
|||
def casa(self): |
|||
casa = CasaLegislativa.objects.first() |
|||
return casa |
|||
|
|||
|
|||
class ModelChoiceView(ListAPIView): |
|||
""" |
|||
Deprecated |
|||
|
|||
TODO Migrar para customização na api automática |
|||
|
|||
""" |
|||
|
|||
# FIXME aplicar permissão correta de usuário |
|||
permission_classes = (IsAuthenticated,) |
|||
serializer_class = ModelChoiceSerializer |
|||
|
|||
def get(self, request, *args, **kwargs): |
|||
self.model = ContentType.objects.get_for_id( |
|||
self.kwargs['content_type']).model_class() |
|||
|
|||
pagination = request.GET.get('pagination', '') |
|||
|
|||
if pagination == 'False': |
|||
self.pagination_class = None |
|||
|
|||
return ListAPIView.get(self, request, *args, **kwargs) |
|||
|
|||
def get_queryset(self): |
|||
return self.model.objects.all() |
|||
|
|||
|
|||
class AutorListView(ListAPIView): |
|||
""" |
|||
Deprecated |
|||
|
|||
TODO Migrar para customização na api automática |
|||
|
|||
Listagem de Autores com filtro para autores já cadastrados |
|||
e/ou possíveis autores. |
|||
|
|||
- tr - tipo do resultado |
|||
Prepera Lista de Autores para 2 cenários distintos |
|||
|
|||
- default = 1 |
|||
|
|||
= 1 -> para (value, text) usados geralmente |
|||
em combobox, radiobox, checkbox, etc com pesquisa básica |
|||
de Autores feita pelo django-filter |
|||
-> processo usado nas pesquisas, o mais usado. |
|||
|
|||
|
|||
= 3 -> Devolve instancias da classe Autor filtradas pelo |
|||
django-filter |
|||
|
|||
- tipo - chave primária do Tipo de Autor a ser filtrado |
|||
|
|||
- q - busca textual no nome do Autor ou em fields_search |
|||
declarados no field SaplGenericRelation das GenericFks |
|||
A busca textual acontece via django-filter com a |
|||
variável `tr` igual 1 ou 3. Em caso contrário, |
|||
o django-filter é desativado e a busca é feita |
|||
no model do ContentType associado ao tipo. |
|||
|
|||
- q_0 / q_1 - q_0 é opcional e quando usado, faz o código ignorar "q"... |
|||
|
|||
q_0 -> campos lookup a serem filtrados em qualquer Model |
|||
que implemente SaplGenericRelation |
|||
q_1 -> o valor que será pesquisado no lookup de q_0 |
|||
|
|||
q_0 e q_1 podem ser separados por ","... isso dará a |
|||
possibilidade de filtrar mais de um campo. |
|||
|
|||
|
|||
http://localhost:8000 |
|||
/api/autor?tr=1&q_0=parlamentar_set__ativo&q_1=False |
|||
/api/autor?tr=1&q_0=parlamentar_set__ativo&q_1=True |
|||
/api/autor?tr=3&q_0=parlamentar_set__ativo&q_1=False |
|||
/api/autor?tr=3&q_0=parlamentar_set__ativo&q_1=True |
|||
|
|||
http://localhost:8000 |
|||
/api/autor?tr=1 |
|||
&q_0=parlamentar_set__nome_parlamentar__icontains, |
|||
parlamentar_set__ativo |
|||
&q_1=Carvalho,False |
|||
/api/autor?tr=1 |
|||
&q_0=parlamentar_set__nome_parlamentar__icontains, |
|||
parlamentar_set__ativo |
|||
&q_1=Carvalho,True |
|||
/api/autor?tr=3 |
|||
&q_0=parlamentar_set__nome_parlamentar__icontains, |
|||
parlamentar_set__ativo |
|||
&q_1=Carvalho,False |
|||
/api/autor?tr=3 |
|||
&q_0=parlamentar_set__nome_parlamentar__icontains, |
|||
parlamentar_set__ativo |
|||
&q_1=Carvalho,True |
|||
|
|||
|
|||
não importa o campo que vc passe de qualquer dos Models |
|||
ligados... é possível ver que models são esses, |
|||
na ocasião do commit deste texto, executando: |
|||
In [6]: from sapl.utils import models_with_gr_for_model |
|||
|
|||
In [7]: models_with_gr_for_model(Autor) |
|||
Out[7]: |
|||
[sapl.parlamentares.models.Parlamentar, |
|||
sapl.parlamentares.models.Frente, |
|||
sapl.comissoes.models.Comissao, |
|||
sapl.materia.models.Orgao, |
|||
sapl.sessao.models.Bancada, |
|||
sapl.sessao.models.Bloco] |
|||
|
|||
qualquer atributo destes models podem ser passados |
|||
para busca |
|||
""" |
|||
logger = logging.getLogger(__name__) |
|||
|
|||
TR_AUTOR_CHOICE_SERIALIZER = 1 |
|||
TR_AUTOR_SERIALIZER = 3 |
|||
|
|||
permission_classes = (IsAuthenticatedOrReadOnly,) |
|||
queryset = Autor.objects.all() |
|||
model = Autor |
|||
|
|||
filter_class = AutorChoiceFilterSet |
|||
filter_backends = (DjangoFilterBackend, ) |
|||
serializer_class = AutorChoiceSerializer |
|||
|
|||
@property |
|||
def tr(self): |
|||
username = self.request.user.username |
|||
try: |
|||
tr = int(self.request.GET.get |
|||
('tr', AutorListView.TR_AUTOR_CHOICE_SERIALIZER)) |
|||
|
|||
if tr not in (AutorListView.TR_AUTOR_CHOICE_SERIALIZER, |
|||
AutorListView.TR_AUTOR_SERIALIZER): |
|||
return AutorListView.TR_AUTOR_CHOICE_SERIALIZER |
|||
except Exception as e: |
|||
self.logger.error('user=' + username + '. ' + str(e)) |
|||
return AutorListView.TR_AUTOR_CHOICE_SERIALIZER |
|||
return tr |
|||
|
|||
def get(self, request, *args, **kwargs): |
|||
if self.tr == AutorListView.TR_AUTOR_SERIALIZER: |
|||
self.serializer_class = AutorSerializer |
|||
self.permission_classes = (IsAuthenticated,) |
|||
|
|||
if self.filter_class and 'q_0' in request.GET: |
|||
self.filter_class = AutorSearchForFieldFilterSet |
|||
|
|||
return ListAPIView.get(self, request, *args, **kwargs) |
|||
|
|||
|
|||
class AutoresProvaveisListView(ListAPIView): |
|||
""" |
|||
Deprecated |
|||
|
|||
TODO Migrar para customização na api automática |
|||
""" |
|||
|
|||
logger = logging.getLogger(__name__) |
|||
|
|||
permission_classes = (IsAuthenticatedOrReadOnly,) |
|||
queryset = Autor.objects.all() |
|||
model = Autor |
|||
|
|||
filter_class = None |
|||
filter_backends = [] |
|||
serializer_class = ChoiceSerializer |
|||
|
|||
def get_queryset(self): |
|||
|
|||
params = {'content_type__isnull': False} |
|||
username = self.request.user.username |
|||
tipo = '' |
|||
try: |
|||
tipo = int(self.request.GET.get('tipo', '')) |
|||
if tipo: |
|||
params['id'] = tipo |
|||
except Exception as e: |
|||
self.logger.error('user= ' + username + '. ' + str(e)) |
|||
pass |
|||
|
|||
tipos = TipoAutor.objects.filter(**params) |
|||
|
|||
if not tipos.exists() and tipo: |
|||
raise Http404() |
|||
|
|||
r = [] |
|||
for tipo in tipos: |
|||
q = self.request.GET.get('q', '').strip() |
|||
|
|||
model_class = tipo.content_type.model_class() |
|||
|
|||
fields = list(filter( |
|||
lambda field: isinstance(field, SaplGenericRelation) and |
|||
field.related_model == Autor, |
|||
model_class._meta.get_fields(include_hidden=True))) |
|||
|
|||
""" |
|||
fields - é um array de SaplGenericRelation que deve possuir o |
|||
atributo fields_search. Verifique na documentação da classe |
|||
a estrutura de fields_search. |
|||
""" |
|||
|
|||
assert len(fields) >= 1, (_( |
|||
'Não foi encontrado em %(model)s um atributo do tipo ' |
|||
'SaplGenericRelation que use o model %(model_autor)s') % { |
|||
'model': model_class._meta.verbose_name, |
|||
'model_autor': Autor._meta.verbose_name}) |
|||
|
|||
qs = model_class.objects.all() |
|||
|
|||
q_filter = Q() |
|||
if q: |
|||
for item in fields: |
|||
if item.related_model != Autor: |
|||
continue |
|||
q_fs = Q() |
|||
for field in item.fields_search: |
|||
q_fs = q_fs | Q(**{'%s%s' % ( |
|||
field[0], |
|||
field[1]): q}) |
|||
q_filter = q_filter & q_fs |
|||
|
|||
qs = qs.filter(q_filter).distinct( |
|||
fields[0].fields_search[0][0]).order_by( |
|||
fields[0].fields_search[0][0]) |
|||
else: |
|||
qs = qs.order_by(fields[0].fields_search[0][0]) |
|||
|
|||
qs = qs.values_list( |
|||
'id', fields[0].fields_search[0][0]) |
|||
r += list(qs) |
|||
|
|||
if tipos.count() > 1: |
|||
r.sort(key=lambda x: x[1].upper()) |
|||
return r |
|||
|
|||
|
|||
class AutoresPossiveisListView(ListAPIView): |
|||
""" |
|||
Deprecated |
|||
|
|||
TODO Migrar para customização na api automática |
|||
""" |
|||
|
|||
permission_classes = (IsAuthenticatedOrReadOnly,) |
|||
queryset = Autor.objects.all() |
|||
model = Autor |
|||
|
|||
pagination_class = None |
|||
|
|||
filter_class = AutoresPossiveisFilterSet |
|||
serializer_class = AutorChoiceSerializer |
|||
|
|||
|
|||
class MateriaLegislativaViewSet(ListModelMixin, |
|||
RetrieveModelMixin, |
|||
GenericViewSet): |
|||
""" |
|||
Deprecated |
|||
|
|||
TODO Migrar para customização na api automática |
|||
""" |
|||
|
|||
permission_classes = (IsAuthenticated,) |
|||
serializer_class = MateriaLegislativaOldSerializer |
|||
queryset = MateriaLegislativa.objects.all() |
|||
filter_backends = (DjangoFilterBackend,) |
|||
filter_fields = ('numero', 'ano', 'tipo', ) |
|||
|
|||
|
|||
class SessaoPlenariaViewSet(ListModelMixin, |
|||
RetrieveModelMixin, |
|||
GenericViewSet): |
|||
""" |
|||
Deprecated |
|||
|
|||
TODO Migrar para customização na api automática |
|||
""" |
|||
|
|||
permission_classes = (AllowAny,) |
|||
serializer_class = SessaoPlenariaOldSerializer |
|||
queryset = SessaoPlenaria.objects.all() |
|||
filter_backends = (DjangoFilterBackend,) |
|||
filter_fields = ('data_inicio', 'data_fim', 'interativa') |
@ -1,278 +1,437 @@ |
|||
import logging |
|||
|
|||
from django import apps |
|||
from django.conf import settings |
|||
from django.contrib.contenttypes.models import ContentType |
|||
from django.db.models import Q |
|||
from django.http import Http404 |
|||
from django.db.models.fields.files import FileField |
|||
from django.utils.decorators import classonlymethod |
|||
from django.utils.text import capfirst |
|||
from django.utils.translation import ugettext_lazy as _ |
|||
from rest_framework.filters import DjangoFilterBackend |
|||
from rest_framework.generics import ListAPIView |
|||
from rest_framework.mixins import ListModelMixin, RetrieveModelMixin |
|||
from rest_framework.permissions import (AllowAny, IsAuthenticated, |
|||
IsAuthenticatedOrReadOnly) |
|||
from rest_framework.viewsets import GenericViewSet |
|||
import django_filters |
|||
from django_filters.filters import CharFilter |
|||
from django_filters.rest_framework.backends import DjangoFilterBackend |
|||
from django_filters.rest_framework.filterset import FilterSet |
|||
from django_filters.utils import resolve_field |
|||
from rest_framework import serializers as rest_serializers |
|||
from rest_framework.decorators import action |
|||
from rest_framework.response import Response |
|||
from rest_framework.viewsets import ModelViewSet |
|||
|
|||
from sapl.api.forms import (AutorChoiceFilterSet, AutoresPossiveisFilterSet, |
|||
AutorSearchForFieldFilterSet) |
|||
from sapl.api.serializers import (AutorChoiceSerializer, AutorSerializer, |
|||
ChoiceSerializer, |
|||
MateriaLegislativaSerializer, |
|||
ModelChoiceSerializer, |
|||
SessaoPlenariaSerializer) |
|||
from sapl.base.models import Autor, TipoAutor |
|||
from sapl.materia.models import MateriaLegislativa |
|||
from sapl.sessao.models import SessaoPlenaria |
|||
from sapl.utils import SaplGenericRelation |
|||
from sapl.api.forms import SaplFilterSetMixin |
|||
from sapl.api.permissions import SaplModelPermissions |
|||
from sapl.api.serializers import ChoiceSerializer |
|||
from sapl.base.models import Autor, AppConfig, DOC_ADM_OSTENSIVO |
|||
from sapl.materia.models import Proposicao |
|||
from sapl.parlamentares.models import Parlamentar |
|||
from sapl.utils import models_with_gr_for_model, choice_anos_com_sessaoplenaria |
|||
|
|||
|
|||
class ModelChoiceView(ListAPIView): |
|||
class BusinessRulesNotImplementedMixin: |
|||
def create(self, request, *args, **kwargs): |
|||
raise Exception(_("POST Create não implementado")) |
|||
|
|||
# FIXME aplicar permissão correta de usuário |
|||
permission_classes = (IsAuthenticated,) |
|||
serializer_class = ModelChoiceSerializer |
|||
def put(self, request, *args, **kwargs): |
|||
raise Exception(_("PUT Update não implementado")) |
|||
|
|||
def get(self, request, *args, **kwargs): |
|||
self.model = ContentType.objects.get_for_id( |
|||
self.kwargs['content_type']).model_class() |
|||
def patch(self, request, *args, **kwargs): |
|||
raise Exception(_("PATCH Partial Update não implementado")) |
|||
|
|||
pagination = request.GET.get('pagination', '') |
|||
def delete(self, request, *args, **kwargs): |
|||
raise Exception(_("DELETE Delete não implementado")) |
|||
|
|||
if pagination == 'False': |
|||
self.pagination_class = None |
|||
|
|||
return ListAPIView.get(self, request, *args, **kwargs) |
|||
class SaplApiViewSetConstrutor(ModelViewSet): |
|||
|
|||
def get_queryset(self): |
|||
return self.model.objects.all() |
|||
filter_backends = (DjangoFilterBackend,) |
|||
|
|||
@classonlymethod |
|||
def build_class(cls): |
|||
import inspect |
|||
from sapl.api import serializers |
|||
|
|||
# Carrega todas as classes de sapl.api.serializers que possuam |
|||
# "Serializer" como Sufixo. |
|||
serializers_classes = inspect.getmembers(serializers) |
|||
serializers_classes = {i[0]: i[1] for i in filter( |
|||
lambda x: x[0].endswith('Serializer'), |
|||
serializers_classes |
|||
)} |
|||
|
|||
# Carrega todas as classes de sapl.api.forms que possuam |
|||
# "FilterSet" como Sufixo. |
|||
from sapl.api import forms |
|||
filters_classes = inspect.getmembers(forms) |
|||
filters_classes = {i[0]: i[1] for i in filter( |
|||
lambda x: x[0].endswith('FilterSet'), |
|||
filters_classes |
|||
)} |
|||
|
|||
built_sets = {} |
|||
|
|||
def build(_model): |
|||
object_name = _model._meta.object_name |
|||
|
|||
# Caso Exista, pega a classe sapl.api.serializers.{model}Serializer |
|||
serializer_name = '{model}Serializer'.format(model=object_name) |
|||
_serializer_class = serializers_classes.get(serializer_name, None) |
|||
|
|||
# Caso Exista, pega a classe sapl.api.forms.{model}FilterSet |
|||
filter_name = '{model}FilterSet'.format(model=object_name) |
|||
_filter_class = filters_classes.get(filter_name, None) |
|||
|
|||
def create_class(): |
|||
# Define uma classe padrão para serializer caso não tenha sido |
|||
# criada a classe sapl.api.serializers.{model}Serializer |
|||
class SaplSerializer(rest_serializers.ModelSerializer): |
|||
class Meta: |
|||
model = _model |
|||
fields = '__all__' |
|||
|
|||
# Define uma classe padrão para filtro caso não tenha sido |
|||
# criada a classe sapl.api.forms.{model}FilterSet |
|||
class SaplFilterSet(SaplFilterSetMixin): |
|||
class Meta(SaplFilterSetMixin.Meta): |
|||
model = _model |
|||
|
|||
# Define uma classe padrão ModelViewSet de DRF |
|||
class ModelSaplViewSet(cls): |
|||
queryset = _model.objects.all() |
|||
|
|||
# Utiliza o filtro customizado pela classe |
|||
# sapl.api.forms.{model}FilterSet |
|||
# ou utiliza o trivial SaplFilterSet definido acima |
|||
filter_class = _filter_class \ |
|||
if _filter_class else SaplFilterSet |
|||
|
|||
# Utiliza o serializer customizado pela classe |
|||
# sapl.api.serializers.{model}Serializer |
|||
# ou utiliza o trivial SaplSerializer definido acima |
|||
serializer_class = _serializer_class \ |
|||
if _serializer_class else SaplSerializer |
|||
|
|||
return ModelSaplViewSet |
|||
|
|||
viewset = create_class() |
|||
viewset.__name__ = '%sModelSaplViewSet' % _model.__name__ |
|||
return viewset |
|||
|
|||
apps_sapl = [apps.apps.get_app_config( |
|||
n[5:]) for n in settings.SAPL_APPS] |
|||
for app in apps_sapl: |
|||
built_sets[app.label] = {} |
|||
for model in app.get_models(): |
|||
built_sets[app.label][model._meta.model_name] = build(model) |
|||
|
|||
return built_sets |
|||
|
|||
|
|||
""" |
|||
1. Constroi uma rest_framework.viewsets.ModelViewSet para |
|||
todos os models de todas as apps do sapl |
|||
2. Define DjangoFilterBackend como ferramenta de filtro dos campos |
|||
3. Define Serializer como a seguir: |
|||
3.1 - Define um Serializer genérico para cada módel |
|||
3.2 - Recupera Serializer customizado em sapl.api.serializers |
|||
3.3 - Para todo model é opcional a existência de |
|||
sapl.api.serializers.{model}Serializer. |
|||
Caso não seja definido um Serializer customizado, utiliza-se o trivial |
|||
4. Define um FilterSet como a seguir: |
|||
4.1 - Define um FilterSet genérico para cada módel |
|||
4.2 - Recupera FilterSet customizado em sapl.api.forms |
|||
4.3 - Para todo model é opcional a existência de |
|||
sapl.api.forms.{model}FilterSet. |
|||
Caso não seja definido um FilterSet customizado, utiliza-se o trivial |
|||
4.4 - todos os campos que aceitam lookup 'exact' |
|||
podem ser filtrados por default |
|||
|
|||
5. SaplApiViewSetConstrutor não cria padrões e/ou exige conhecimento alem dos |
|||
exigidos pela DRF. |
|||
|
|||
6. As rotas são criadas seguindo nome da app e nome do model |
|||
http://localhost:9000/api/{applabel}/{model_name}/ |
|||
e seguem as variações definidas em: |
|||
https://www.django-rest-framework.org/api-guide/routers/#defaultrouter |
|||
|
|||
7. Todas as viewsets construídas por SaplApiViewSetConstrutor e suas rotas |
|||
(paginate list, detail, edit, create, delete) |
|||
bem como testes em ambiente de desenvolvimento podem ser conferidas em: |
|||
http://localhost:9000/api/ |
|||
desde que settings.DEBUG=True |
|||
|
|||
**SaplSetViews** é um dict de dicts de models conforme: |
|||
{ |
|||
... |
|||
|
|||
'audiencia': { |
|||
'tipoaudienciapublica': TipoAudienciaPublicaViewSet, |
|||
'audienciapublica': AudienciaPublicaViewSet, |
|||
'anexoaudienciapublica': AnexoAudienciaPublicaViewSet |
|||
|
|||
... |
|||
|
|||
}, |
|||
|
|||
... |
|||
|
|||
'base': { |
|||
'casalegislativa': CasaLegislativaViewSet, |
|||
'appconfig': AppConfigViewSet, |
|||
|
|||
... |
|||
|
|||
} |
|||
|
|||
... |
|||
|
|||
} |
|||
""" |
|||
|
|||
SaplSetViews = SaplApiViewSetConstrutor.build_class() |
|||
|
|||
# Toda Classe construida acima, pode ser redefinida e aplicado quaisquer |
|||
# das possibilidades para uma classe normal criada a partir de |
|||
# rest_framework.viewsets.ModelViewSet conforme exemplo para a classe autor |
|||
|
|||
|
|||
class AutorListView(ListAPIView): |
|||
# Customização para AutorViewSet com implementação de actions específicas |
|||
class _AutorViewSet(SaplSetViews['base']['autor']): |
|||
""" |
|||
Listagem de Autores com filtro para autores já cadastrados |
|||
e/ou possíveis autores. |
|||
|
|||
- tr - tipo do resultado |
|||
Prepera Lista de Autores para 3 cenários distintos |
|||
|
|||
- default = 1 |
|||
|
|||
= 1 -> para (value, text) usados geralmente |
|||
em combobox, radiobox, checkbox, etc com pesquisa básica |
|||
de Autores feita pelo django-filter |
|||
-> processo usado nas pesquisas, o mais usado. |
|||
|
|||
|
|||
= 3 -> Devolve instancias da classe Autor filtradas pelo |
|||
django-filter |
|||
|
|||
- tipo - chave primária do Tipo de Autor a ser filtrado |
|||
|
|||
- q - busca textual no nome do Autor ou em fields_search |
|||
declarados no field SaplGenericRelation das GenericFks |
|||
A busca textual acontece via django-filter com a |
|||
variável `tr` igual 1 ou 3. Em caso contrário, |
|||
o django-filter é desativado e a busca é feita |
|||
no model do ContentType associado ao tipo. |
|||
|
|||
- q_0 / q_1 - q_0 é opcional e quando usado, faz o código ignorar "q"... |
|||
|
|||
q_0 -> campos lookup a serem filtrados em qualquer Model |
|||
que implemente SaplGenericRelation |
|||
q_1 -> o valor que será pesquisado no lookup de q_0 |
|||
|
|||
q_0 e q_1 podem ser separados por ","... isso dará a |
|||
possibilidade de filtrar mais de um campo. |
|||
|
|||
|
|||
http://localhost:8000 |
|||
/api/autor?tr=1&q_0=parlamentar_set__ativo&q_1=False |
|||
/api/autor?tr=1&q_0=parlamentar_set__ativo&q_1=True |
|||
/api/autor?tr=3&q_0=parlamentar_set__ativo&q_1=False |
|||
/api/autor?tr=3&q_0=parlamentar_set__ativo&q_1=True |
|||
|
|||
http://localhost:8000 |
|||
/api/autor?tr=1 |
|||
&q_0=parlamentar_set__nome_parlamentar__icontains, |
|||
parlamentar_set__ativo |
|||
&q_1=Carvalho,False |
|||
/api/autor?tr=1 |
|||
&q_0=parlamentar_set__nome_parlamentar__icontains, |
|||
parlamentar_set__ativo |
|||
&q_1=Carvalho,True |
|||
/api/autor?tr=3 |
|||
&q_0=parlamentar_set__nome_parlamentar__icontains, |
|||
parlamentar_set__ativo |
|||
&q_1=Carvalho,False |
|||
/api/autor?tr=3 |
|||
&q_0=parlamentar_set__nome_parlamentar__icontains, |
|||
parlamentar_set__ativo |
|||
&q_1=Carvalho,True |
|||
|
|||
|
|||
não importa o campo que vc passe de qualquer dos Models |
|||
ligados... é possível ver que models são esses, |
|||
na ocasião do commit deste texto, executando: |
|||
In [6]: from sapl.utils import models_with_gr_for_model |
|||
|
|||
In [7]: models_with_gr_for_model(Autor) |
|||
Out[7]: |
|||
[sapl.parlamentares.models.Parlamentar, |
|||
sapl.parlamentares.models.Frente, |
|||
sapl.comissoes.models.Comissao, |
|||
sapl.materia.models.Orgao, |
|||
sapl.sessao.models.Bancada, |
|||
sapl.sessao.models.Bloco] |
|||
|
|||
qualquer atributo destes models podem ser passados |
|||
para busca |
|||
Neste exemplo de customização do que foi criado em |
|||
SaplApiViewSetConstrutor além do ofertado por |
|||
rest_framework.viewsets.ModelViewSet, dentre outras customizações |
|||
possíveis, foi adicionado as rotas referentes aos relacionamentos genéricos |
|||
|
|||
* padrão de ModelViewSet |
|||
/api/base/autor/ POST - create |
|||
/api/base/autor/ GET - list |
|||
/api/base/autor/{pk}/ GET - detail |
|||
/api/base/autor/{pk}/ PUT - update |
|||
/api/base/autor/{pk}/ PATCH - partial_update |
|||
/api/base/autor/{pk}/ DELETE - destroy |
|||
|
|||
* rotas desta classe local: |
|||
/api/base/autor/parlamentar |
|||
devolve apenas autores que são parlamentares |
|||
/api/base/autor/comissao |
|||
devolve apenas autores que são comissões |
|||
/api/base/autor/bloco |
|||
devolve apenas autores que são blocos parlamentares |
|||
/api/base/autor/bancada |
|||
devolve apenas autores que são bancadas parlamentares |
|||
/api/base/autor/frente |
|||
devolve apenas autores que são Frene parlamentares |
|||
/api/base/autor/orgao |
|||
devolve apenas autores que são Órgãos |
|||
|
|||
|
|||
""" |
|||
logger = logging.getLogger(__name__) |
|||
|
|||
TR_AUTOR_CHOICE_SERIALIZER = 1 |
|||
TR_AUTOR_SERIALIZER = 3 |
|||
def list_for_content_type(self, content_type): |
|||
qs = self.get_queryset() |
|||
qs = qs.filter(content_type=content_type) |
|||
|
|||
permission_classes = (IsAuthenticatedOrReadOnly,) |
|||
queryset = Autor.objects.all() |
|||
model = Autor |
|||
page = self.paginate_queryset(qs) |
|||
if page is not None: |
|||
serializer = self.serializer_class(page, many=True) |
|||
return self.get_paginated_response(serializer.data) |
|||
|
|||
filter_class = AutorChoiceFilterSet |
|||
filter_backends = (DjangoFilterBackend, ) |
|||
serializer_class = AutorChoiceSerializer |
|||
serializer = self.get_serializer(page, many=True) |
|||
return Response(serializer.data) |
|||
|
|||
@property |
|||
def tr(self): |
|||
username = self.request.user.username |
|||
try: |
|||
tr = int(self.request.GET.get |
|||
('tr', AutorListView.TR_AUTOR_CHOICE_SERIALIZER)) |
|||
@classonlymethod |
|||
def build_class_with_actions(cls): |
|||
|
|||
if tr not in (AutorListView.TR_AUTOR_CHOICE_SERIALIZER, |
|||
AutorListView.TR_AUTOR_SERIALIZER): |
|||
return AutorListView.TR_AUTOR_CHOICE_SERIALIZER |
|||
except Exception as e: |
|||
self.logger.error('user=' + username + '. ' + str(e)) |
|||
return AutorListView.TR_AUTOR_CHOICE_SERIALIZER |
|||
return tr |
|||
models_with_gr_for_autor = models_with_gr_for_model(Autor) |
|||
|
|||
def get(self, request, *args, **kwargs): |
|||
if self.tr == AutorListView.TR_AUTOR_SERIALIZER: |
|||
self.serializer_class = AutorSerializer |
|||
self.permission_classes = (IsAuthenticated,) |
|||
for _model in models_with_gr_for_autor: |
|||
|
|||
if self.filter_class and 'q_0' in request.GET: |
|||
self.filter_class = AutorSearchForFieldFilterSet |
|||
@action(detail=False, name=_model._meta.model_name) |
|||
def actionclass(self, request, *args, **kwargs): |
|||
model = getattr(self, self.action)._AutorViewSet__model |
|||
|
|||
return ListAPIView.get(self, request, *args, **kwargs) |
|||
content_type = ContentType.objects.get_for_model(model) |
|||
return self.list_for_content_type(content_type) |
|||
|
|||
func = actionclass |
|||
func.mapping['get'] = func.kwargs['name'] |
|||
func.url_name = func.kwargs['name'] |
|||
func.url_path = func.kwargs['name'] |
|||
func.__model = _model |
|||
|
|||
class AutoresProvaveisListView(ListAPIView): |
|||
logger = logging.getLogger(__name__) |
|||
setattr(cls, _model._meta.model_name, func) |
|||
return cls |
|||
|
|||
permission_classes = (IsAuthenticatedOrReadOnly,) |
|||
queryset = Autor.objects.all() |
|||
model = Autor |
|||
|
|||
filter_class = None |
|||
filter_backends = [] |
|||
serializer_class = ChoiceSerializer |
|||
class _ParlamentarViewSet(SaplSetViews['parlamentares']['parlamentar']): |
|||
@action(detail=True) |
|||
def proposicoes(self, request, *args, **kwargs): |
|||
""" |
|||
Lista de proposições públicas de parlamentar específico |
|||
|
|||
:param int id: - Identificador do parlamentar que se quer recuperar as proposições |
|||
:return: uma lista de proposições |
|||
""" |
|||
# /api/parlamentares/parlamentar/{id}/proposicoes/ |
|||
# recupera proposições enviadas e incorporadas do parlamentar |
|||
# deve coincidir com |
|||
# /parlamentar/{pk}/proposicao |
|||
content_type = ContentType.objects.get_for_model(Parlamentar) |
|||
|
|||
qs = Proposicao.objects.filter( |
|||
data_envio__isnull=False, |
|||
data_recebimento__isnull=False, |
|||
cancelado=False, |
|||
autor__object_id=kwargs['pk'], |
|||
autor__content_type=content_type |
|||
) |
|||
|
|||
page = self.paginate_queryset(qs) |
|||
if page is not None: |
|||
serializer = SaplSetViews[ |
|||
'materia']['proposicao'].serializer_class(page, many=True) |
|||
return self.get_paginated_response(serializer.data) |
|||
|
|||
serializer = self.get_serializer(page, many=True) |
|||
return Response(serializer.data) |
|||
|
|||
|
|||
class _ProposicaoViewSet(SaplSetViews['materia']['proposicao']): |
|||
""" |
|||
list: |
|||
Retorna lista de Proposições |
|||
|
|||
* Permissões: |
|||
|
|||
* Usuário Dono: |
|||
* Pode listar todas suas Proposições |
|||
|
|||
* Usuário Conectado ou Anônimo: |
|||
* Pode listar todas as Proposições incorporadas |
|||
|
|||
retrieve: |
|||
Retorna uma proposição passada pelo 'id' |
|||
|
|||
* Permissões: |
|||
|
|||
* Usuário Dono: |
|||
* Pode recuperar qualquer de suas Proposições |
|||
|
|||
* Usuário Conectado ou Anônimo: |
|||
* Pode recuperar qualquer das proposições incorporadas |
|||
|
|||
""" |
|||
class ProposicaoPermission(SaplModelPermissions): |
|||
def has_permission(self, request, view): |
|||
if request.method == 'GET': |
|||
return True |
|||
# se a solicitação é list ou detail, libera o teste de permissão |
|||
# e deixa o get_queryset filtrar de acordo com a regra de |
|||
# visibilidade das proposições, ou seja: |
|||
# 1. proposição incorporada é proposição pública |
|||
# 2. não incorporada só o autor pode ver |
|||
else: |
|||
perm = super().has_permission(request, view) |
|||
return perm |
|||
# não é list ou detail, então passa pelas regras de permissão e, |
|||
# depois disso ainda passa pelo filtro de get_queryset |
|||
|
|||
permission_classes = (ProposicaoPermission, ) |
|||
|
|||
def get_queryset(self): |
|||
qs = super().get_queryset() |
|||
|
|||
params = {'content_type__isnull': False} |
|||
username = self.request.user.username |
|||
tipo = '' |
|||
try: |
|||
tipo = int(self.request.GET.get('tipo', '')) |
|||
if tipo: |
|||
params['id'] = tipo |
|||
except Exception as e: |
|||
self.logger.error('user= ' + username + '. ' + str(e)) |
|||
pass |
|||
q = Q(data_recebimento__isnull=False, object_id__isnull=False) |
|||
if not self.request.user.is_anonymous(): |
|||
q |= Q(autor__user=self.request.user) |
|||
|
|||
tipos = TipoAutor.objects.filter(**params) |
|||
qs = qs.filter(q) |
|||
return qs |
|||
|
|||
if not tipos.exists() and tipo: |
|||
raise Http404() |
|||
|
|||
r = [] |
|||
for tipo in tipos: |
|||
q = self.request.GET.get('q', '').strip() |
|||
class _DocumentoAdministrativoViewSet(SaplSetViews['protocoloadm']['documentoadministrativo']): |
|||
|
|||
model_class = tipo.content_type.model_class() |
|||
class DocumentoAdministrativoPermission(SaplModelPermissions): |
|||
def has_permission(self, request, view): |
|||
if request.method == 'GET': |
|||
comportamento = AppConfig.attr('documentos_administrativos') |
|||
if comportamento == DOC_ADM_OSTENSIVO: |
|||
return True |
|||
""" |
|||
Diante da lógica implementada na manutenção de documentos |
|||
administrativos: |
|||
- Se o comportamento é doc adm ostensivo, deve passar pelo |
|||
teste de permissões sem avaliá-las |
|||
- se o comportamento é doc adm restritivo, deve passar pelo |
|||
teste de permissões avaliando-as |
|||
""" |
|||
return super().has_permission(request, view) |
|||
|
|||
fields = list(filter( |
|||
lambda field: isinstance(field, SaplGenericRelation) and |
|||
field.related_model == Autor, |
|||
model_class._meta.get_fields(include_hidden=True))) |
|||
permission_classes = (DocumentoAdministrativoPermission, ) |
|||
|
|||
def get_queryset(self): |
|||
""" |
|||
fields - é um array de SaplGenericRelation que deve possuir o |
|||
atributo fields_search. Verifique na documentação da classe |
|||
a estrutura de fields_search. |
|||
mesmo tendo passado pelo teste de permissões, deve ser filtrado, |
|||
pelo campo restrito. Sendo este igual a True, disponibilizar apenas |
|||
a um usuário conectado. Apenas isso, sem critérios outros de permissão, |
|||
conforme implementado em DocumentoAdministrativoCrud |
|||
""" |
|||
qs = super().get_queryset() |
|||
|
|||
assert len(fields) >= 1, (_( |
|||
'Não foi encontrado em %(model)s um atributo do tipo ' |
|||
'SaplGenericRelation que use o model %(model_autor)s') % { |
|||
'model': model_class._meta.verbose_name, |
|||
'model_autor': Autor._meta.verbose_name}) |
|||
|
|||
qs = model_class.objects.all() |
|||
|
|||
q_filter = Q() |
|||
if q: |
|||
for item in fields: |
|||
if item.related_model != Autor: |
|||
continue |
|||
q_fs = Q() |
|||
for field in item.fields_search: |
|||
q_fs = q_fs | Q(**{'%s%s' % ( |
|||
field[0], |
|||
field[1]): q}) |
|||
q_filter = q_filter & q_fs |
|||
|
|||
qs = qs.filter(q_filter).distinct( |
|||
fields[0].fields_search[0][0]).order_by( |
|||
fields[0].fields_search[0][0]) |
|||
else: |
|||
qs = qs.order_by(fields[0].fields_search[0][0]) |
|||
if self.request.user.is_anonymous(): |
|||
qs = qs.exclude(restrito=True) |
|||
return qs |
|||
|
|||
|
|||
class _DocumentoAcessorioAdministrativoViewSet( |
|||
SaplSetViews['protocoloadm']['documentoacessorioadministrativo']): |
|||
|
|||
qs = qs.values_list( |
|||
'id', fields[0].fields_search[0][0]) |
|||
r += list(qs) |
|||
permission_classes = ( |
|||
_DocumentoAdministrativoViewSet.DocumentoAdministrativoPermission, ) |
|||
|
|||
if tipos.count() > 1: |
|||
r.sort(key=lambda x: x[1].upper()) |
|||
return r |
|||
def get_queryset(self): |
|||
qs = super().get_queryset() |
|||
|
|||
if self.request.user.is_anonymous(): |
|||
qs = qs.exclude(documento__restrito=True) |
|||
return qs |
|||
|
|||
class AutoresPossiveisListView(ListAPIView): |
|||
|
|||
permission_classes = (IsAuthenticatedOrReadOnly,) |
|||
queryset = Autor.objects.all() |
|||
model = Autor |
|||
class _TramitacaoAdministrativoViewSet( |
|||
SaplSetViews['protocoloadm']['tramitacaoadministrativo'], |
|||
BusinessRulesNotImplementedMixin): |
|||
# TODO: Implementar regras de manutenção das tramitações de docs adms |
|||
|
|||
pagination_class = None |
|||
permission_classes = ( |
|||
_DocumentoAdministrativoViewSet.DocumentoAdministrativoPermission, ) |
|||
|
|||
filter_class = AutoresPossiveisFilterSet |
|||
serializer_class = AutorChoiceSerializer |
|||
def get_queryset(self): |
|||
qs = super().get_queryset() |
|||
|
|||
if self.request.user.is_anonymous(): |
|||
qs = qs.exclude(documento__restrito=True) |
|||
return qs |
|||
|
|||
class MateriaLegislativaViewSet(ListModelMixin, |
|||
RetrieveModelMixin, |
|||
GenericViewSet): |
|||
|
|||
permission_classes = (IsAuthenticated,) |
|||
serializer_class = MateriaLegislativaSerializer |
|||
queryset = MateriaLegislativa.objects.all() |
|||
filter_backends = (DjangoFilterBackend,) |
|||
filter_fields = ('numero', 'ano', 'tipo', ) |
|||
class _SessaoPlenariaViewSet( |
|||
SaplSetViews['sessao']['sessaoplenaria']): |
|||
|
|||
@action(detail=False) |
|||
def years(self, request, *args, **kwargs): |
|||
years = choice_anos_com_sessaoplenaria() |
|||
|
|||
class SessaoPlenariaViewSet(ListModelMixin, |
|||
RetrieveModelMixin, |
|||
GenericViewSet): |
|||
serializer = ChoiceSerializer(years, many=True) |
|||
return Response(serializer.data) |
|||
|
|||
permission_classes = (AllowAny,) |
|||
serializer_class = SessaoPlenariaSerializer |
|||
queryset = SessaoPlenaria.objects.all() |
|||
filter_backends = (DjangoFilterBackend,) |
|||
filter_fields = ('data_inicio', 'data_fim', 'interativa') |
|||
|
|||
SaplSetViews['base']['autor'] = _AutorViewSet.build_class_with_actions() |
|||
|
|||
SaplSetViews['materia']['proposicao'] = _ProposicaoViewSet |
|||
|
|||
SaplSetViews['parlamentares']['parlamentar'] = _ParlamentarViewSet |
|||
|
|||
SaplSetViews['protocoloadm']['documentoadministrativo'] = _DocumentoAdministrativoViewSet |
|||
SaplSetViews['protocoloadm']['documentoacessorioadministrativo'] = _DocumentoAcessorioAdministrativoViewSet |
|||
SaplSetViews['protocoloadm']['tramitacaoadministrativo'] = _TramitacaoAdministrativoViewSet |
|||
|
|||
SaplSetViews['sessao']['sessaoplenaria'] = _SessaoPlenariaViewSet |
|||
|
@ -0,0 +1,34 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-02-19 18:11 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.utils.timezone |
|||
import sapl.utils |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('audiencia', '0009_remove_anexoaudienciapublica_indexacao'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='anexoaudienciapublica', |
|||
name='arquivo', |
|||
field=models.FileField(default='Assunto não existente.', upload_to=sapl.utils.texto_upload_path, verbose_name='Arquivo'), |
|||
preserve_default=False, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='anexoaudienciapublica', |
|||
name='assunto', |
|||
field=models.TextField(verbose_name='Assunto'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='anexoaudienciapublica', |
|||
name='data', |
|||
field=models.DateField(auto_now=True, default=django.utils.timezone.now), |
|||
preserve_default=False, |
|||
), |
|||
] |
@ -1,11 +1,10 @@ |
|||
from django.conf.urls import include, url |
|||
from sapl.audiencia.views import (index, AudienciaCrud,AnexoAudienciaPublicaCrud) |
|||
from sapl.audiencia.views import (index, AudienciaCrud, AnexoAudienciaPublicaCrud) |
|||
|
|||
from .apps import AppConfig |
|||
|
|||
app_name = AppConfig.name |
|||
|
|||
urlpatterns = [ |
|||
url(r'^audiencia/', include(AudienciaCrud.get_urls() + |
|||
AnexoAudienciaPublicaCrud.get_urls())), |
|||
url(r'^audiencia/', include(AudienciaCrud.get_urls() + AnexoAudienciaPublicaCrud.get_urls())), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2018-12-11 20:25 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('base', '0026_auto_20181126_1727'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='appconfig', |
|||
name='relatorios_atos', |
|||
field=models.CharField(choices=[('S', 'Sim'), ('N', 'Não')], default='N', max_length=1, verbose_name='Relatórios de atos acessados'), |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2018-12-18 17:03 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('base', '0027_appconfig_relatorios_atos'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='appconfig', |
|||
name='estatisticas_acesso_normas', |
|||
field=models.CharField(choices=[('S', 'Sim'), ('N', 'Não')], default='N', max_length=1, verbose_name='Estatísticas de acesso a normas'), |
|||
), |
|||
] |
@ -0,0 +1,19 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2018-12-18 18:40 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('base', '0028_appconfig_estatisticas_acesso_normas'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RemoveField( |
|||
model_name='appconfig', |
|||
name='relatorios_atos', |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-02-19 11:14 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('base', '0029_remove_appconfig_relatorios_atos'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='appconfig', |
|||
name='escolher_numero_materia_proposicao', |
|||
field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Indicar número da matéria a ser gerada na proposição?'), |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-02-15 18:25 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('base', '0029_remove_appconfig_relatorios_atos'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='appconfig', |
|||
name='protocolo_manual', |
|||
field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Protocolar proposição somente com recibo?'), |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-02-18 14:09 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('base', '0030_appconfig_protocolo_manual'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='appconfig', |
|||
name='protocolo_manual', |
|||
field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Informar data e hora de protocolo?'), |
|||
), |
|||
] |
@ -0,0 +1,16 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-02-19 12:41 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('base', '0031_auto_20190218_1109'), |
|||
('base', '0030_appconfig_escolher_numero_materia_proposicao'), |
|||
] |
|||
|
|||
operations = [ |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2018-12-14 12:23 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('comissoes', '0018_auto_20180924_1724'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='reuniao', |
|||
name='hora_fim', |
|||
field=models.TimeField(blank=True, null=True, verbose_name='Horário de Término (hh:mm)'), |
|||
), |
|||
] |
@ -0,0 +1,285 @@ |
|||
from datetime import datetime |
|||
|
|||
import oaipmh |
|||
import oaipmh.error |
|||
import oaipmh.metadata |
|||
import oaipmh.server |
|||
from django.urls import reverse |
|||
from lxml import etree |
|||
from lxml.builder import ElementMaker |
|||
|
|||
from sapl.base.models import AppConfig, CasaLegislativa |
|||
from sapl.lexml.models import LexmlPublicador |
|||
from sapl.norma.models import NormaJuridica |
|||
|
|||
|
|||
class OAILEXML: |
|||
""" |
|||
Padrao OAI do LeXML |
|||
Esta registrado sobre o nome 'oai_lexml' |
|||
""" |
|||
|
|||
def __init__(self, prefix): |
|||
self.prefix = prefix |
|||
self.ns = {'oai_lexml': 'http://www.lexml.gov.br/oai_lexml', } |
|||
self.schemas = {'oai_lexml': 'http://projeto.lexml.gov.br/esquemas/oai_lexml.xsd'} |
|||
|
|||
def __call__(self, element, metadata): |
|||
data = metadata.record |
|||
value = etree.XML(data['metadata']) |
|||
element.append(value) |
|||
|
|||
|
|||
class OAIServer: |
|||
""" |
|||
An OAI-2.0 compliant oai server. |
|||
Underlying code is based on pyoai's oaipmh.server' |
|||
""" |
|||
|
|||
XSI_NS = 'http://www.w3.org/2001/XMLSchema-instance' |
|||
ns = {'lexml': 'http://www.lexml.gov.br/oai_lexml'} |
|||
schema = {'oai_lexml': 'http://projeto.lexml.gov.br/esquemas/oai_lexml.xsd'} |
|||
|
|||
def __init__(self, config={}): |
|||
self.config = config |
|||
|
|||
def identify(self): |
|||
result = oaipmh.common.Identify( |
|||
repositoryName=self.config['titulo'], |
|||
baseURL=self.config['base_url'], |
|||
protocolVersion='2.0', |
|||
adminEmails=self.config['email'], |
|||
earliestDatestamp=datetime(2001, 1, 1, 10, 00), |
|||
deletedRecord='transient', |
|||
granularity='YYYY-MM-DDThh:mm:ssZ', |
|||
compression=['identity'], |
|||
toolkit_description=False) |
|||
if not self.config['descricao']: |
|||
result.add_description(self.config['descricao']) |
|||
return result |
|||
|
|||
def create_header_and_metadata(self, record): |
|||
header = self.create_header(record) |
|||
metadata = oaipmh.common.Metadata(None, record['metadata']) |
|||
metadata.record = record |
|||
return header, metadata |
|||
|
|||
def list_query(self, from_date=None, until_date=None, offset=0, batch_size=10, identifier=None): |
|||
if identifier: |
|||
identifier = int(identifier.split('/')[-1]) # Get internal id |
|||
else: |
|||
identifier = '' |
|||
until_date = datetime.now() if not until_date or until_date > datetime.now() else until_date |
|||
return self.oai_query(offset=offset, batch_size=batch_size, from_date=from_date, until_date=until_date, |
|||
identifier=identifier) |
|||
|
|||
def check_metadata_prefix(self, metadata_prefix): |
|||
if not metadata_prefix in self.config['metadata_prefixes']: |
|||
raise oaipmh.error.CannotDisseminateFormatError |
|||
|
|||
def listRecords(self, metadataPrefix, from_date=None, until_date=None, cursor=0, batch_size=10): |
|||
self.check_metadata_prefix(metadataPrefix) |
|||
for record in self.list_query(from_date, until_date, cursor, batch_size): |
|||
header, metadata = self.create_header_and_metadata(record) |
|||
yield header, metadata, None # None? |
|||
|
|||
def get_oai_id(self, internal_id): |
|||
return "oai:{}".format(internal_id) |
|||
|
|||
def create_header(self, record): |
|||
oai_id = self.get_oai_id(record['record']['id']) |
|||
timestamp = record['record']['when_modified'] |
|||
timestamp = timestamp.replace(tzinfo=None) |
|||
sets = [] |
|||
deleted = record['record']['deleted'] |
|||
return oaipmh.common.Header(None, oai_id, timestamp, sets, deleted) |
|||
|
|||
def get_esfera_federacao(self): |
|||
appconfig = AppConfig.objects.first() |
|||
return appconfig.esfera_federacao |
|||
|
|||
def recupera_norma(self, offset, batch_size, from_date, until_date, identifier, esfera): |
|||
kwargs = {'data__lte': until_date} |
|||
if from_date: |
|||
kwargs['data__gte'] = from_date |
|||
if identifier: |
|||
kwargs['numero'] = identifier |
|||
if esfera: |
|||
kwargs['esfera_federacao'] = esfera |
|||
return NormaJuridica.objects.select_related('tipo').filter(**kwargs)[offset:offset + batch_size] |
|||
|
|||
def monta_id(self, norma): |
|||
if norma: |
|||
num = len(casa.endereco_web.split('.')) |
|||
dominio = '.'.join(casa.endereco_web.split('.')[1:num]) |
|||
prefixo_oai = '{}.{}:sapl/'.format(casa.sigla.lower(), dominio) |
|||
numero_interno = norma.numero |
|||
tipo_norma = norma.tipo.equivalente_lexml |
|||
ano_norma = norma.ano |
|||
identificador = '{}{};{};{}'.format(prefixo_oai, tipo_norma, ano_norma, numero_interno) |
|||
return identificador |
|||
else: |
|||
return None |
|||
|
|||
def monta_urn(self, norma, esfera): |
|||
if norma: |
|||
urn = 'urn:lex:br;' |
|||
esferas = {'M': 'municipal', 'E': 'estadual'} |
|||
municipio = casa.municipio.lower() |
|||
uf = casa.uf.lower() |
|||
for x in [' ', '.de.', '.da.', '.das.', '.do.', '.dos.']: |
|||
municipio = municipio.replace(x, '.') |
|||
uf = uf.replace(x, '.') |
|||
if esfera == 'M': |
|||
urn += '{};{}:'.format(uf, municipio) |
|||
if norma.tipo.equivalente_lexml == 'regimento.interno' or norma.tipo.equivalente_lexml == 'resolucao': |
|||
urn += 'camara.' |
|||
urn += esferas[esfera] + ':' |
|||
elif esfera == 'E': |
|||
urn += '{}:{}:'.format(uf, esferas[esfera]) |
|||
else: |
|||
urn += ':' |
|||
if norma.tipo.equivalente_lexml: |
|||
urn += '{}:{};'.format(norma.tipo.equivalente_lexml, norma.data.isoformat()) |
|||
else: |
|||
urn += '{};'.format(norma.data.isoformat()) |
|||
if norma.tipo.equivalente_lexml == 'lei.organica' or norma.tipo.equivalente_lexml == 'constituicao': |
|||
urn += norma.ano |
|||
else: |
|||
urn += norma.numero |
|||
if norma.data_vigencia and norma.data_publicacao: |
|||
urn += '@{};publicacao;{}'.format(norma.data_vigencia.isoformat(), norma.data_publicacao.isoformat()) |
|||
elif norma.data_publicacao: |
|||
urn += '@inicio.vigencia;publicacao;{}'.format(norma.data_publicacao.isoformat()) |
|||
return urn |
|||
else: |
|||
return None |
|||
|
|||
def data_por_extenso(self, data): |
|||
data = data.strftime('%d-%m-%Y') |
|||
if data != '': |
|||
meses = {1: 'Janeiro', 2: 'Fevereiro', 3: 'Março', 4: 'Abril', 5: 'Maio', 6: 'Junho', 7: 'Julho', |
|||
8: 'Agosto', 9: 'Setembro', 10: 'Outubro', 11: 'Novembro', 12: 'Dezembro'} |
|||
return '{} de {} de {}'.format(data[0:2], meses[int(data[3:5])], data[6:]) |
|||
else: |
|||
return '' |
|||
|
|||
def monta_xml(self, urn, norma): |
|||
publicador = LexmlPublicador.objects.first() |
|||
if norma and publicador: |
|||
LEXML = ElementMaker(namespace=self.ns['lexml'], nsmap=self.ns) |
|||
oai_lexml = LEXML.LexML() |
|||
oai_lexml.attrib['{{}}schemaLocation'.format(self.XSI_NS)] = '{} {}'.format( |
|||
'http://www.lexml.gov.br/oai_lexml', 'http://projeto.lexml.gov.br/esquemas/oai_lexml.xsd') |
|||
texto_integral = norma.texto_integral |
|||
mime_types = {'doc': 'application/msword', |
|||
'docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', |
|||
'odt': 'application/vnd.oasis.opendocument.text', |
|||
'pdf': 'application/pdf', |
|||
'rtf': 'application/rtf'} |
|||
if texto_integral: |
|||
url_conteudo = self.config['base_url'] + texto_integral.url |
|||
extensao = texto_integral.url.split('.')[-1] |
|||
formato = mime_types.get(extensao, 'application/octet-stream') |
|||
else: |
|||
formato = 'text/html' |
|||
url_conteudo = self.config['base_url'] + reverse('sapl.norma:normajuridica_detail', |
|||
kwargs={'pk': norma.numero}) |
|||
element_maker = ElementMaker() |
|||
id_publicador = str(publicador.id_publicador) |
|||
item_conteudo = element_maker.Item(url_conteudo, formato=formato, idPublicador=id_publicador, |
|||
tipo='conteudo') |
|||
oai_lexml.append(item_conteudo) |
|||
url = self.config['base_url'] + reverse('sapl.norma:normajuridica_detail', kwargs={'pk': norma.numero}) |
|||
item_metadado = element_maker.Item(url, formato='text/html', idPublicador=id_publicador, tipo='metadado') |
|||
oai_lexml.append(item_metadado) |
|||
documento_individual = element_maker.DocumentoIndividual(urn) |
|||
oai_lexml.append(documento_individual) |
|||
if norma.tipo.equivalente_lexml == 'lei.organica': |
|||
epigrafe = '{} de {} - {}, de {}'.format(norma.tipo.descricao, casa.municipio, |
|||
casa.uf, norma.ano) |
|||
elif norma.tipo.equivalente_lexml == 'constituicao': |
|||
epigrafe = '{} do Estado de {}, de {}'.format(norma.tipo.descricao, casa.municipio, |
|||
norma.ano) |
|||
else: |
|||
epigrafe = '{} n° {}, de {}'.format(norma.tipo.descricao, norma.numero, |
|||
self.data_por_extenso(norma.data)) |
|||
oai_lexml.append(element_maker.Epigrafe(epigrafe)) |
|||
oai_lexml.append(element_maker.Ementa(norma.ementa)) |
|||
indexacao = norma.indexacao |
|||
if indexacao: |
|||
oai_lexml.append(element_maker.Indexacao(indexacao)) |
|||
return etree.tostring(oai_lexml) |
|||
else: |
|||
return None |
|||
|
|||
def oai_query(self, offset=0, batch_size=10, from_date=None, until_date=None, identifier=None): |
|||
esfera = self.get_esfera_federacao() |
|||
offset = 0 if offset < 0 else offset |
|||
batch_size = 10 if batch_size < 0 else batch_size |
|||
until_date = datetime.now() if not until_date or until_date > datetime.now() else until_date |
|||
normas = self.recupera_norma(offset, batch_size, from_date, until_date, identifier, esfera) |
|||
for norma in normas: |
|||
resultado = {} |
|||
identificador = self.monta_id(norma) |
|||
urn = self.monta_urn(norma, esfera) |
|||
xml_lexml = self.monta_xml(urn, norma) |
|||
resultado['tx_metadado_xml'] = xml_lexml |
|||
resultado['cd_status'] = 'N' |
|||
resultado['id'] = identificador |
|||
resultado['when_modified'] = norma.timestamp |
|||
resultado['deleted'] = 0 |
|||
yield {'record': resultado, |
|||
'metadata': resultado['tx_metadado_xml']} |
|||
|
|||
|
|||
def OAIServerFactory(config={}): |
|||
""" |
|||
Create a new OAI batching OAI Server given a config and a database |
|||
""" |
|||
for prefix in config['metadata_prefixes']: |
|||
metadata_registry = oaipmh.metadata.MetadataRegistry() |
|||
metadata_registry.registerWriter(prefix, OAILEXML(prefix)) |
|||
return oaipmh.server.BatchingServer( |
|||
OAIServer(config), |
|||
metadata_registry=metadata_registry, |
|||
resumption_batch_size=config['batch_size'] |
|||
) |
|||
|
|||
|
|||
casa = None |
|||
|
|||
|
|||
def casa_legislativa(): |
|||
global casa |
|||
if not casa: |
|||
casa = CasaLegislativa.objects.first() |
|||
return casa if casa else CasaLegislativa() # retorna objeto dummy |
|||
|
|||
|
|||
def get_config(url, batch_size): |
|||
config = {'content_type': None, |
|||
'delay': 0, |
|||
'base_asset_path': None, |
|||
'metadata_prefixes': ['oai_lexml']} |
|||
config.update({'titulo': casa_legislativa().nome, # Inicializa variável global casa |
|||
'email': casa.email, |
|||
'base_url': url[:url.find('/', 8)], |
|||
'descricao': casa.informacao_geral, |
|||
'batch_size': batch_size}) |
|||
return config |
|||
|
|||
|
|||
if __name__ == '__main__': |
|||
""" |
|||
Para executar localmente (estando no diretório raiz): |
|||
|
|||
$ ./manage.py shell_plus |
|||
|
|||
Executar comando |
|||
%run sapl/lexml/OAIServer.py |
|||
""" |
|||
oai_server = OAIServerFactory(get_config('http://127.0.0.1:8000/', 10)) |
|||
r = oai_server.handleRequest({'verb': 'ListRecords', |
|||
'metadataPrefix': 'oai_lexml'}) |
|||
print(r.decode('UTF-8')) |
@ -1,6 +1,18 @@ |
|||
from django.http import HttpResponse |
|||
|
|||
from sapl.crud.base import CrudAux |
|||
from sapl.lexml.OAIServer import OAIServerFactory, get_config |
|||
|
|||
from .models import LexmlProvedor, LexmlPublicador |
|||
|
|||
LexmlProvedorCrud = CrudAux.build(LexmlProvedor, 'lexml_provedor') |
|||
LexmlPublicadorCrud = CrudAux.build(LexmlPublicador, 'lexml_publicador') |
|||
|
|||
|
|||
def lexml_request(request): |
|||
config = get_config(request.get_raw_uri(), int(request.GET.get('batch_size', 10))) |
|||
oai_server = OAIServerFactory(config) |
|||
r = oai_server.handleRequest({'verb': request.GET.get('verb', 'ListRecords'), |
|||
'metadataPrefix': request.GET.get('metadataPrefix', 'oai_lexml')}) |
|||
response = r.decode('UTF-8') |
|||
return HttpResponse(response, content_type='text/xml') |
|||
|
@ -0,0 +1,35 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2019-01-01 18:18 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('materia', '0033_auto_20181030_1039'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='materialegislativa', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='materialegislativa', |
|||
name='ano_origem_externa', |
|||
field=models.PositiveSmallIntegerField(blank=True, choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], null=True, verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='numeracao', |
|||
name='ano_materia', |
|||
field=models.PositiveSmallIntegerField(choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='proposicao', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(blank=True, choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], default=None, null=True, verbose_name='Ano'), |
|||
), |
|||
] |
@ -0,0 +1,35 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2019-01-07 16:02 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('materia', '0033_auto_20181030_1039'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='materialegislativa', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='materialegislativa', |
|||
name='ano_origem_externa', |
|||
field=models.PositiveSmallIntegerField(blank=True, choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], null=True, verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='numeracao', |
|||
name='ano_materia', |
|||
field=models.PositiveSmallIntegerField(choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='proposicao', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(blank=True, choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], default=None, null=True, verbose_name='Ano'), |
|||
), |
|||
] |
@ -0,0 +1,35 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2019-01-04 12:21 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('materia', '0034_auto_20190101_1618'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='materialegislativa', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='materialegislativa', |
|||
name='ano_origem_externa', |
|||
field=models.PositiveSmallIntegerField(blank=True, choices=[(2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], null=True, verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='numeracao', |
|||
name='ano_materia', |
|||
field=models.PositiveSmallIntegerField(choices=[(2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='proposicao', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(blank=True, choices=[(2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], default=None, null=True, verbose_name='Ano'), |
|||
), |
|||
] |
@ -0,0 +1,41 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2019-01-06 05:30 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('materia', '0035_auto_20190104_1021'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='materialegislativa', |
|||
name='data_apresentacao', |
|||
field=models.DateField(verbose_name='Data de Apresentação'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='materialegislativa', |
|||
name='data_publicacao', |
|||
field=models.DateField(blank=True, null=True, verbose_name='Data de Publicação'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='materialegislativa', |
|||
name='local_origem_externa', |
|||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.Origem', verbose_name='Local de Origem'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='materialegislativa', |
|||
name='numero_protocolo', |
|||
field=models.PositiveIntegerField(blank=True, null=True, verbose_name='Número do Protocolo'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='materialegislativa', |
|||
name='tipo', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.TipoMateriaLegislativa', verbose_name='Tipo de Matéria Legislativa'), |
|||
), |
|||
] |
@ -0,0 +1,16 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10 on 2019-01-08 17:38 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('materia', '0036_auto_20190106_0330'), |
|||
('materia', '0034_auto_20190107_1402'), |
|||
] |
|||
|
|||
operations = [ |
|||
] |
@ -0,0 +1,35 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10 on 2019-01-08 18:06 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('materia', '0037_merge_20190108_1538'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='materialegislativa', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='materialegislativa', |
|||
name='ano_origem_externa', |
|||
field=models.PositiveSmallIntegerField(blank=True, choices=[(2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], null=True, verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='numeracao', |
|||
name='ano_materia', |
|||
field=models.PositiveSmallIntegerField(choices=[(2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='proposicao', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(blank=True, choices=[(2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], default=None, null=True, verbose_name='Ano'), |
|||
), |
|||
] |
@ -0,0 +1,21 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.18 on 2019-02-10 01:46 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('materia', '0038_auto_20190108_1606'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='tipoproposicao', |
|||
name='content_type', |
|||
field=models.ForeignKey(default=None, help_text='\n Quando uma proposição é incorporada, ela é convertida de proposição\n para outro elemento dentro do Sapl. Existem alguns elementos que\n uma proposição pode se tornar. Defina este meta-tipo e em seguida\n escolha um Tipo Correspondente!\n ', on_delete=django.db.models.deletion.PROTECT, to='contenttypes.ContentType', verbose_name='Conversão de Meta-Tipos'), |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.18 on 2019-02-11 18:02 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('materia', '0039_auto_20190209_2346'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='tramitacao', |
|||
name='turno', |
|||
field=models.CharField(blank=True, choices=[('P', 'Primeiro'), ('S', 'Segundo'), ('U', 'Único'), ('L', 'Suplementar'), ('F', 'Final'), ('A', 'Votação única em Regime de Urgência'), ('B', '1ª Votação'), ('C', '2ª e 3ª Votação'), ('D', 'Deliberação'), ('E', '1ª e 2ª votações em regime de urgência')], max_length=1, verbose_name='Turno'), |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-02-15 11:10 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('materia', '0040_auto_20190211_1602'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='proposicao', |
|||
name='numero_materia_futuro', |
|||
field=models.PositiveIntegerField(blank=True, null=True, verbose_name='Número Matéria'), |
|||
), |
|||
] |
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2018-12-17 18:44 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('norma', '0016_tipovinculonormajuridica_revoga_integramente'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.CreateModel( |
|||
name='NormaEstatisticas', |
|||
fields=[ |
|||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|||
('usuario', models.CharField(max_length=50)), |
|||
('horario_acesso', models.DateTimeField(auto_now=True, null=True)), |
|||
('norma', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='norma.NormaJuridica')), |
|||
], |
|||
), |
|||
] |
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2019-01-01 18:18 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('norma', '0017_normaestatisticas'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='anexonormajuridica', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='normajuridica', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2018-12-19 18:35 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('norma', '0017_normaestatisticas'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='normaestatisticas', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], default=2018, verbose_name='Ano'), |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2018-12-19 20:07 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('norma', '0018_normaestatisticas_ano'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='normaestatisticas', |
|||
name='horario_acesso', |
|||
field=models.DateTimeField(blank=True, null=True), |
|||
), |
|||
] |
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2019-01-04 12:21 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('norma', '0018_auto_20190101_1618'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='anexonormajuridica', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='normajuridica', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
] |
@ -0,0 +1,31 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2019-01-06 06:54 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('norma', '0019_auto_20190104_1021'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='normajuridica', |
|||
name='data_publicacao', |
|||
field=models.DateField(blank=True, null=True, verbose_name='Data de Publicação'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='normajuridica', |
|||
name='tipo', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='norma.TipoNormaJuridica', verbose_name='Tipo da Norma Jurídica'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='normajuridica', |
|||
name='veiculo_publicacao', |
|||
field=models.CharField(blank=True, max_length=30, verbose_name='Veículo de Publicação'), |
|||
), |
|||
] |
@ -0,0 +1,31 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2019-01-07 16:07 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import sapl.norma.models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('norma', '0019_auto_20181219_1807'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='anexonormajuridica', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='normaestatisticas', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], default=sapl.norma.models.get_ano_atual, verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='normajuridica', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
] |
@ -0,0 +1,16 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10 on 2019-01-08 17:38 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('norma', '0020_auto_20190107_1407'), |
|||
('norma', '0020_auto_20190106_0454'), |
|||
] |
|||
|
|||
operations = [ |
|||
] |
@ -0,0 +1,21 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10 on 2019-01-08 18:06 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import sapl.norma.models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('norma', '0021_merge_20190108_1538'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='normaestatisticas', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], default=sapl.norma.models.get_ano_atual, verbose_name='Ano'), |
|||
), |
|||
] |
@ -0,0 +1,19 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-02-19 18:35 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('norma', '0022_auto_20190108_1606'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterModelOptions( |
|||
name='normarelacionada', |
|||
options={'ordering': ('norma_principal__ano', 'norma_relacionada__ano'), 'verbose_name': 'Norma Relacionada', 'verbose_name_plural': 'Normas Relacionadas'}, |
|||
), |
|||
] |
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2018-12-12 21:00 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('protocoloadm', '0009_merge'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='protocolo', |
|||
name='justificativa_anulacao', |
|||
field=models.CharField(blank=True, max_length=260, verbose_name='Motivo'), |
|||
), |
|||
] |
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2019-01-01 18:18 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('protocoloadm', '0010_auto_20181212_1900'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='documentoadministrativo', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='protocolo', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano do Protocolo'), |
|||
), |
|||
] |
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2019-01-07 16:07 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('protocoloadm', '0010_auto_20181212_1900'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='documentoadministrativo', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='protocolo', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano do Protocolo'), |
|||
), |
|||
] |
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2019-01-04 12:21 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('protocoloadm', '0011_auto_20190101_1618'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='documentoadministrativo', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='protocolo', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano do Protocolo'), |
|||
), |
|||
] |
@ -0,0 +1,26 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2019-01-06 15:36 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('protocoloadm', '0012_auto_20190104_1021'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='protocolo', |
|||
name='tipo_documento', |
|||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.TipoDocumentoAdministrativo', verbose_name='Tipo de Documento'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='protocolo', |
|||
name='tipo_materia', |
|||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.TipoMateriaLegislativa', verbose_name='Tipo de Matéria'), |
|||
), |
|||
] |
@ -0,0 +1,35 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2019-01-10 15:00 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('protocoloadm', '0013_auto_20190106_1336'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='protocolo', |
|||
name='ip_data_hora_manual', |
|||
field=models.CharField(blank=True, help_text='Endereço IP da estação de trabalho do usuário que está realizando Protocolo e informando data e hora manualmente.', max_length=15, verbose_name='IP'), |
|||
), |
|||
migrations.AddField( |
|||
model_name='protocolo', |
|||
name='user_data_hora_manual', |
|||
field=models.CharField(blank=True, help_text='Usuário que está realizando Protocolo e informando data e hora manualmente.', max_length=20, verbose_name='IP'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='protocolo', |
|||
name='data', |
|||
field=models.DateField(blank=True, help_text='Informado manualmente', null=True, verbose_name='Data do Protocolo'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='protocolo', |
|||
name='hora', |
|||
field=models.TimeField(blank=True, help_text='Informado manualmente', null=True, verbose_name='Hora do Protocolo'), |
|||
), |
|||
] |
@ -0,0 +1,16 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10 on 2019-01-08 17:38 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('protocoloadm', '0011_auto_20190107_1407'), |
|||
('protocoloadm', '0013_auto_20190106_1336'), |
|||
] |
|||
|
|||
operations = [ |
|||
] |
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10 on 2019-01-08 18:06 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('protocoloadm', '0014_merge_20190108_1538'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='documentoadministrativo', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='protocolo', |
|||
name='ano', |
|||
field=models.PositiveSmallIntegerField(choices=[(2020, 2020), (2019, 2019), (2018, 2018), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano do Protocolo'), |
|||
), |
|||
] |
@ -0,0 +1,21 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.8 on 2019-01-10 15:43 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.utils.timezone |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('protocoloadm', '0014_auto_20190110_1300'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='protocolo', |
|||
name='timestamp_data_hora_manual', |
|||
field=models.DateTimeField(default=django.utils.timezone.now), |
|||
), |
|||
] |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue