|
@ -1,15 +1,13 @@ |
|
|
import hashlib |
|
|
|
|
|
import logging |
|
|
|
|
|
import os |
|
|
|
|
|
import re |
|
|
|
|
|
from datetime import date |
|
|
from datetime import date |
|
|
from functools import wraps |
|
|
from functools import wraps |
|
|
from unicodedata import normalize as unicodedata_normalize |
|
|
|
|
|
from subprocess import PIPE, call |
|
|
from subprocess import PIPE, call |
|
|
from threading import Thread |
|
|
from threading import Thread |
|
|
|
|
|
from unicodedata import normalize as unicodedata_normalize |
|
|
|
|
|
import hashlib |
|
|
|
|
|
import logging |
|
|
|
|
|
import os |
|
|
|
|
|
import re |
|
|
|
|
|
|
|
|
import django_filters |
|
|
|
|
|
import magic |
|
|
|
|
|
from crispy_forms.helper import FormHelper |
|
|
from crispy_forms.helper import FormHelper |
|
|
from crispy_forms.layout import HTML, Button |
|
|
from crispy_forms.layout import HTML, Button |
|
|
from django import forms |
|
|
from django import forms |
|
@ -22,10 +20,13 @@ from django.core.exceptions import ValidationError |
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
from floppyforms import ClearableFileInput |
|
|
from floppyforms import ClearableFileInput |
|
|
from reversion.admin import VersionAdmin |
|
|
from reversion.admin import VersionAdmin |
|
|
|
|
|
import django_filters |
|
|
|
|
|
import magic |
|
|
|
|
|
|
|
|
from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row |
|
|
from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row |
|
|
from sapl.settings import BASE_DIR, PROJECT_DIR |
|
|
from sapl.settings import BASE_DIR, PROJECT_DIR |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sapl_logger = logging.getLogger(BASE_DIR.name) |
|
|
sapl_logger = logging.getLogger(BASE_DIR.name) |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -159,8 +160,8 @@ class SaplGenericRelation(GenericRelation): |
|
|
assert isinstance(field, (tuple, list)), _( |
|
|
assert isinstance(field, (tuple, list)), _( |
|
|
'fields_search deve ser um array de tuplas ou listas.') |
|
|
'fields_search deve ser um array de tuplas ou listas.') |
|
|
|
|
|
|
|
|
assert len(field) == 2, _( |
|
|
assert len(field) <= 3, _( |
|
|
'cada tupla de fields_search deve possuir duas strins') |
|
|
'cada tupla de fields_search deve possuir até 3 strings') |
|
|
|
|
|
|
|
|
# TODO implementar assert para validar campos do Model e lookups |
|
|
# TODO implementar assert para validar campos do Model e lookups |
|
|
|
|
|
|
|
@ -637,6 +638,7 @@ def texto_upload_path(instance, filename, subpath=''): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UpdateIndexCommand(Thread): |
|
|
class UpdateIndexCommand(Thread): |
|
|
|
|
|
|
|
|
def run(self): |
|
|
def run(self): |
|
|
call([PROJECT_DIR.child('manage.py'), 'update_index'], |
|
|
call([PROJECT_DIR.child('manage.py'), 'update_index'], |
|
|
stdout=PIPE) |
|
|
stdout=PIPE) |
|
|