mirror of https://github.com/interlegis/sapl.git
Eduardo Calil
8 years ago
7 changed files with 63 additions and 2 deletions
@ -0,0 +1,27 @@ |
|||
from django.db.models.signals import post_delete, post_save |
|||
from sapl.settings import PROJECT_DIR |
|||
from subprocess import PIPE, call |
|||
from threading import Thread |
|||
|
|||
|
|||
from .models import NormaJuridica |
|||
|
|||
|
|||
class UpdateIndexCommand(Thread): |
|||
def run(self): |
|||
call([PROJECT_DIR.child('manage.py'), 'update_index'], |
|||
stdout=PIPE) |
|||
|
|||
|
|||
def save_texto(sender, instance, **kwargs): |
|||
update_index = UpdateIndexCommand() |
|||
update_index.start() |
|||
|
|||
|
|||
def delete_texto(sender, instance, **kwargs): |
|||
update_index = UpdateIndexCommand() |
|||
update_index.start() |
|||
|
|||
|
|||
post_save.connect(save_texto, sender=NormaJuridica) |
|||
post_delete.connect(delete_texto, sender=NormaJuridica) |
@ -0,0 +1,7 @@ |
|||
{% for k, v in extracted.metadata.items %} |
|||
{% for val in v %} |
|||
{{ k }}: {{ val|safe }} |
|||
{% endfor %} |
|||
{% endfor %} |
|||
|
|||
{{ extracted|striptags|safe }} |
Loading…
Reference in new issue