ranking pieces in reverse chronological order on CP view
This commit is contained in:
@@ -24,14 +24,16 @@ def do_update(user,mode='rower',days=42):
|
||||
now_date = timezone.now().strftime('%Y-%m-%d')
|
||||
ms = PowerTimeFitnessMetric.objects.filter(
|
||||
user=user,
|
||||
workoutmode=mode)
|
||||
workoutmode=mode).order_by("-date")
|
||||
|
||||
if len(ms) == 0:
|
||||
max_workout_id = 0
|
||||
last_update_date = '1972-01-01'
|
||||
else:
|
||||
max_workout_id = max([m.last_workout for m in ms])
|
||||
last_update_date = max([m.date.strftime('%Y-%m-%d') for m in ms])
|
||||
last_update_date = ms[0].date.strftime('%Y-%m-%d')
|
||||
|
||||
#last_update_date = max([m.date.strftime('%Y-%m-%d') for m in ms])
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user