mirror of https://github.com/interlegis/sapl.git
Eduardo Edson Batista Cordeiro Alves
8 years ago
8 changed files with 134 additions and 13 deletions
@ -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