|
|
@@ -16,6 +16,7 @@ from graphos.sources.model import ModelDataSource
|
|
16
|
16
|
import random
|
|
17
|
17
|
import math
|
|
18
|
18
|
import copy
|
|
|
19
|
+import functools
|
|
19
|
20
|
from django.utils import timezone
|
|
20
|
21
|
|
|
21
|
22
|
# JSS above this limit will not be displayed on the home page col graph
|
|
|
@@ -51,8 +52,13 @@ def home(request):
|
|
51
|
52
|
myCounter.lastReset.selfSeum = False
|
|
52
|
53
|
myCounter.lastReset.delta = datetime.now(
|
|
53
|
54
|
) - myCounter.lastReset.timestamp.replace(tzinfo=None)
|
|
54
|
|
- myCounter.likeCount = Like.objects.filter(
|
|
55
|
|
- reset=myCounter.lastReset).count()
|
|
|
55
|
+ likesMe = Like.objects.filter(
|
|
|
56
|
+ reset=myCounter.lastReset)
|
|
|
57
|
+ myCounter.likeCount = likesMe.count()
|
|
|
58
|
+ if myCounter.likeCount:
|
|
|
59
|
+ myCounter.likersString = functools.reduce(
|
|
|
60
|
+ lambda a,b: a + ", " + b,
|
|
|
61
|
+ [like.liker.trigramme for like in likesMe])
|
|
56
|
62
|
myCounter.lastReset.formatted_delta = format_timedelta(
|
|
57
|
63
|
myCounter.lastReset.delta, locale='fr', threshold=1)
|
|
58
|
64
|
except Counter.DoesNotExist:
|