[chronojump-server] Column times of resultSprint table has been replaced by four new float columns t1, t2, t3 and t4 for r



commit 3966a1f2a274811a93292f04c971d149d74be8a1
Author: Marcos Venteo <mventeo gmail com>
Date:   Mon Aug 7 15:39:34 2017 +0200

    Column times of resultSprint table has been replaced by four new float columns t1,t2,t3 and t4 for 
representing the times.\nThe Sprint page now show these four new columns instead of times

 chronojumpserver/js/sprints.js |   29 ++++++++++++++++++++++++++---
 chronojumpserver/models.py     |   22 ++++++++++++++++------
 2 files changed, 42 insertions(+), 9 deletions(-)
---
diff --git a/chronojumpserver/js/sprints.js b/chronojumpserver/js/sprints.js
index e36953f..79e3e4e 100644
--- a/chronojumpserver/js/sprints.js
+++ b/chronojumpserver/js/sprints.js
@@ -108,9 +108,32 @@ $(document).ready(function() {
         data: "distances"
       },
       {
-        type: "html",
-        title: "Temps",
-        data: "times"
+        type: "num",
+        title: "t1",
+        data: "t1",
+        className: 'colResult',
+        render: $.fn.dataTable.render.number('', ',', 2)
+      },
+      {
+        type: "num",
+        title: "t2",
+        data: "t2",
+        className: 'colResult',
+        render: $.fn.dataTable.render.number('', ',', 2)
+      },
+      {
+        type: "num",
+        title: "t3",
+        data: "t4",
+        className: 'colResult',
+        render: $.fn.dataTable.render.number('', ',', 2)
+      },
+      {
+        type: "num",
+        title: "t4",
+        data: "t4",
+        className: 'colResult',
+        render: $.fn.dataTable.render.number('', ',', 2)
       },
       {
         type: "num",
diff --git a/chronojumpserver/models.py b/chronojumpserver/models.py
index ebb1c5a..09c776e 100755
--- a/chronojumpserver/models.py
+++ b/chronojumpserver/models.py
@@ -395,26 +395,33 @@ class ResultSprint(Base):
     personId = Column('personId', ForeignKey('person.id'))
     person = relationship(Person, primaryjoin=personId == Person.id)
     distances = Column('distances', String(50))
-    times = Column('times', String(50))
     k = Column('k', Float)
     vmax = Column('vmax', Float)
     amax = Column('amax', Float)
     fmax = Column('fmax', Float)
     pmax = Column('pmax', Float)
-
-    def __init__(self, dt=None, personId=None, distances=None, times=None,
-                 k=None, vmax=None, amax=None, fmax=None, pmax=None):
+    t1 = Column('t1', Float)
+    t2 = Column('t2', Float)
+    t3 = Column('t3', Float)
+    t4 = Column('t4', Float)
+
+    def __init__(self, dt=None, personId=None, distances=None,
+                 t1=None, t2=None, t3=None, t4=None, k=None, vmax=None,
+                 amax=None, fmax=None, pmax=None):
         """Object initialization."""
         self.dt = dt if dt is not None else datetime.now()
         # Rest of values will be assigned directly from params
         self.personId = personId
         self.distances = distances
-        self.times = times
         self.k = k
         self.vmax = vmax
         self.amax = amax
         self.fmax = fmax
         self.pmax = pmax
+        self.t1 = t1
+        self.t2 = t2
+        self.t3 = t3
+        self.t4 = t4
 
     @property
     def serialize(self):
@@ -425,7 +432,10 @@ class ResultSprint(Base):
             'personId': self.personId,
             'personName': self.person.name,
             'distances': self.distances,
-            'times': self.times,
+            't1': self.t1,
+            't2': self.t2,
+            't3': self.t3,
+            't4': self.t4,
             'k': self.k,
             'vmax': self.vmax,
             'amax': self.amax,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]