aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
authorAlban Gruin2017-09-24 18:13:44 +0200
committerAlban Gruin2017-09-24 18:13:44 +0200
commit020d204d393ebf8c7f2bc9f6848cd4892b278f70 (patch)
treed4f7fcf3bddc133c231a92dc06257261dc26a7dd /models.py
parenta4fbe45dcdc89dbcfe50afd5058b0ecf09ed7642 (diff)
Récupération de la dernière mise à jour en filtrant par emploi du temps
Changement de la valeur par défaut de last_update, qui posait problème get_week, pas get_weeks
Diffstat (limited to 'models.py')
-rw-r--r--models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/models.py b/models.py
index e284c28..b1d6d27 100644
--- a/models.py
+++ b/models.py
@@ -16,6 +16,7 @@
from django.db import models
from django.db.models import Count, Manager, Q
from django.db.models.functions import ExtractWeek, ExtractYear
+from django.utils import timezone
from django.utils.text import slugify
from .utils import parse_group
@@ -143,7 +144,7 @@ class Course(models.Model):
begin = models.DateTimeField(verbose_name="début du cours", db_index=True)
end = models.DateTimeField(verbose_name="fin du cours")
- last_update = models.DateTimeField(verbose_name="dernière mise à jour", auto_now_add=True)
+ last_update = models.DateTimeField(verbose_name="dernière mise à jour", default=timezone.now)
def __str__(self):
return self.name