Skip to content

Commit

Permalink
Merge pull request #65 from Juerodriguez/optimization-code
Browse files Browse the repository at this point in the history
Optimization code
  • Loading branch information
NicolasSandoval authored Aug 18, 2021
2 parents 91f0777 + a931ee6 commit de9313d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
8 changes: 3 additions & 5 deletions controllers/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
# mostrando un resumen de la tarea junto con accesos al expediente
__author__ = "María Andrea Vignau ([email protected])"
__copyright__ = "(C) 2016 María Andrea Vignau. GNU GPL 3."

import datetime


@auth.requires_login()
def view():
expte_grid = SQLFORM.grid(
Expand All @@ -28,14 +26,14 @@ def view():
exportclasses=myexport)
query_agenda = (db.agenda.created_by == auth.user.id)
query_agenda &= (db.agenda.estado == 'P')
ahora = datetime.datetime.now()
ahora = request.now
query_semana = query_agenda & (db.agenda.vencimiento > ahora)
query_vencidos = query_agenda & (
db.agenda.vencimiento < ahora)
ahora += datetime.timedelta(7)
if not request.is_local:
update_task_week(ahora) # Para mantener visible la agenda en tareas urgentes en la version de testeo online
query_semana &= (db.agenda.vencimiento < ahora)
query_vencidos = query_agenda & (
db.agenda.vencimiento < datetime.datetime.now())

semanal_grid = SQLFORM.grid(
query_semana,
Expand Down
3 changes: 2 additions & 1 deletion controllers/expedientes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import tempfile
from collections import OrderedDict
from xhtml2pdf import pisa
LINKED_TABLES = ['movimiento', 'agenda', 'parte']
LINKED_TABLES = ['movimiento', 'parte']
ZIP_FILENAME = 'Movimiento.zip'
CHUNK_SIZE = 4096

Expand Down Expand Up @@ -125,6 +125,7 @@ def convert_html_to_pdf(source_html, output_filename):

def vista_expediente():
'muestra un panel a la izquierda que tiene los datos del expediente y permite navegar en él'
LINKED_TABLES.append("agenda")
expte = SQLFORM(db.expediente,
int(request.args[0]),
formstyle='bootstrap',
Expand Down
7 changes: 0 additions & 7 deletions views/expedientes/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,3 @@ <h1>Expedientes</h1>
$('#parte_caracter').width('25%')

</script>
<script>
$(function() {
$("td>a>span").each(function() {
if ($(this).html()=="Agendas")
$(this).parent().css('display','none');
});
});</script>

0 comments on commit de9313d

Please sign in to comment.