mirror of https://github.com/interlegis/sapl.git
Eduardo Edson Batista Cordeiro Alves
8 years ago
committed by
GitHub
13 changed files with 326 additions and 35 deletions
@ -0,0 +1,41 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.9.7 on 2016-11-23 13:59 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('norma', '0022_auto_20161110_0910'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AlterModelOptions( |
||||
|
name='vinculonormajuridica', |
||||
|
options={'verbose_name': 'Tipo de Vínculo entre Normas Jurídicas', 'verbose_name_plural': 'Tipos de Vínculos entre Normas Jurídicas'}, |
||||
|
), |
||||
|
migrations.RemoveField( |
||||
|
model_name='vinculonormajuridica', |
||||
|
name='norma_referente', |
||||
|
), |
||||
|
migrations.RemoveField( |
||||
|
model_name='vinculonormajuridica', |
||||
|
name='norma_referida', |
||||
|
), |
||||
|
migrations.RemoveField( |
||||
|
model_name='vinculonormajuridica', |
||||
|
name='tipo_vinculo', |
||||
|
), |
||||
|
migrations.AddField( |
||||
|
model_name='vinculonormajuridica', |
||||
|
name='descricao', |
||||
|
field=models.CharField(blank=True, max_length=20, verbose_name='Descrição'), |
||||
|
), |
||||
|
migrations.AddField( |
||||
|
model_name='vinculonormajuridica', |
||||
|
name='sigla', |
||||
|
field=models.CharField(blank=True, max_length=1, verbose_name='Nome'), |
||||
|
), |
||||
|
] |
@ -0,0 +1,25 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.9.7 on 2016-11-23 14:30 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('norma', '0023_auto_20161123_1359'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AlterField( |
||||
|
model_name='vinculonormajuridica', |
||||
|
name='descricao', |
||||
|
field=models.CharField(blank=True, max_length=50, verbose_name='Descrição'), |
||||
|
), |
||||
|
migrations.AlterField( |
||||
|
model_name='vinculonormajuridica', |
||||
|
name='sigla', |
||||
|
field=models.CharField(blank=True, max_length=1, verbose_name='Sigla'), |
||||
|
), |
||||
|
] |
@ -0,0 +1,29 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.9.7 on 2016-11-23 14:44 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
import django.db.models.deletion |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('norma', '0024_auto_20161123_1430'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.CreateModel( |
||||
|
name='NormaRelacionada', |
||||
|
fields=[ |
||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
||||
|
('norma_principal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='norma_principal', to='norma.NormaJuridica')), |
||||
|
('norma_relacionada', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='norma_relacionada', to='norma.NormaJuridica')), |
||||
|
('tipo_vinculo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='norma.VinculoNormaJuridica')), |
||||
|
], |
||||
|
options={ |
||||
|
'verbose_name': 'Norma Relacionada', |
||||
|
'verbose_name_plural': 'Normas Relacionadas', |
||||
|
}, |
||||
|
), |
||||
|
] |
@ -0,0 +1,21 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.9.7 on 2016-11-23 14:50 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
import django.db.models.deletion |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('norma', '0025_normarelacionada'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AlterField( |
||||
|
model_name='normarelacionada', |
||||
|
name='tipo_vinculo', |
||||
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='norma.VinculoNormaJuridica', verbose_name='Tipo de Vínculo'), |
||||
|
), |
||||
|
] |
@ -0,0 +1,26 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.9.7 on 2016-11-23 15:38 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
import django.db.models.deletion |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('norma', '0026_auto_20161123_1450'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AlterField( |
||||
|
model_name='normarelacionada', |
||||
|
name='norma_principal', |
||||
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='norma_principal', to='norma.NormaJuridica', verbose_name='Norma Principal'), |
||||
|
), |
||||
|
migrations.AlterField( |
||||
|
model_name='normarelacionada', |
||||
|
name='norma_relacionada', |
||||
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='norma_relacionada', to='norma.NormaJuridica', verbose_name='Norma Relacionada'), |
||||
|
), |
||||
|
] |
@ -0,0 +1,27 @@ |
|||||
|
{% extends "crud/form.html" %} |
||||
|
{% load i18n %} |
||||
|
{% load crispy_forms_tags %} |
||||
|
{% load common_tags %} |
||||
|
|
||||
|
{% block extra_js %} |
||||
|
<script language="Javascript"> |
||||
|
function recuperar_norma() { |
||||
|
var tipo = $("#id_tipo").val() |
||||
|
var numero = $("#id_numero").val() |
||||
|
var ano = $("#id_ano").val() |
||||
|
|
||||
|
if (tipo && numero && ano) { |
||||
|
$.get("/norma/recuperar-norma",{tipo: tipo, |
||||
|
numero: numero, |
||||
|
ano: ano}, |
||||
|
function(data, status) { |
||||
|
$("#id_ementa").val(data.ementa); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
var fields = ["#id_tipo", "#id_numero", "#id_ano"] |
||||
|
for (i = 0; i < fields.length; i++) { |
||||
|
$(fields[i]).change(recuperar_norma); |
||||
|
} |
||||
|
</script> |
||||
|
{% endblock %} |
Loading…
Reference in new issue