-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from Juerodriguez/optimization-code
Optimization code
- Loading branch information
Showing
3 changed files
with
5 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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( | ||
|
@@ -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, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters