|
@ -1,4 +1,5 @@ |
|
|
import os |
|
|
import os |
|
|
|
|
|
from functools import lru_cache |
|
|
|
|
|
|
|
|
from crispy_forms.helper import FormHelper |
|
|
from crispy_forms.helper import FormHelper |
|
|
from crispy_forms.layout import HTML, ButtonHolder, Fieldset, Layout, Submit |
|
|
from crispy_forms.layout import HTML, ButtonHolder, Fieldset, Layout, Submit |
|
@ -15,6 +16,11 @@ import sapl |
|
|
from .models import CasaLegislativa |
|
|
from .models import CasaLegislativa |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@lru_cache(maxsize=1) |
|
|
|
|
|
def get_casalegislativa(): |
|
|
|
|
|
return CasaLegislativa.objects.first() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class HelpView(TemplateView): |
|
|
class HelpView(TemplateView): |
|
|
# XXX treat non existing template as a 404!!!! |
|
|
# XXX treat non existing template as a 404!!!! |
|
|
|
|
|
|
|
@ -199,6 +205,10 @@ class CasaLegislativaTableAuxView(FormMixin, GenericView): |
|
|
casa_save.save() |
|
|
casa_save.save() |
|
|
else: |
|
|
else: |
|
|
form.save() |
|
|
form.save() |
|
|
|
|
|
|
|
|
|
|
|
# Invalida cache de consulta |
|
|
|
|
|
get_casalegislativa.cache_clear() |
|
|
|
|
|
|
|
|
return self.form_valid(form) |
|
|
return self.form_valid(form) |
|
|
else: |
|
|
else: |
|
|
return self.render_to_response({'form': form}) |
|
|
return self.render_to_response({'form': form}) |
|
|