]> git.parisson.com Git - teleforma.git/commitdiff
reorder by -session
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Sun, 15 Jun 2025 23:26:16 +0000 (01:26 +0200)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Sun, 15 Jun 2025 23:26:16 +0000 (01:26 +0200)
teleforma/webclass/models.py

index c71359f02bc817f18e3ef2e8293c6b9d4ad00ee2..d631cb422981618c344ab446acb5c7c1266f2dcb 100644 (file)
@@ -122,7 +122,7 @@ def get_records(period_id=None, course_id=None, rooms=None, recording_id=None):
     if not all_records:
         return []
 
-    all_records = sorted(all_records, key=lambda record: record['start'])
+    all_records = sorted(all_records, key=lambda record: -record['start'])
     # for record in all_records:
     #     vocabulary.append((record['url'], record['start']))
     return all_records
@@ -461,6 +461,7 @@ class WebclassRecord(models.Model):
         db_table = app_label + '_' + 'webclass_record'
         verbose_name = 'enregistrement'
         verbose_name_plural = 'enregistrements'
+        ordering = '-session'
 
     def __str__(self):
         return "Enregistrement webclass %d" % self.id