|
|
@@ -57,8 +57,8 @@ def home(request):
|
|
57
|
57
|
myCounter.likeCount = likesMe.count()
|
|
58
|
58
|
if myCounter.likeCount:
|
|
59
|
59
|
myCounter.likersString = functools.reduce(
|
|
60
|
|
- lambda a,b: a + ", " + b,
|
|
61
|
|
- [like.liker.trigramme for like in likesMe])
|
|
|
60
|
+ lambda a, b: a + ", " + b,
|
|
|
61
|
+ [like.liker.trigramme for like in likesMe])
|
|
62
|
62
|
myCounter.lastReset.formatted_delta = format_timedelta(
|
|
63
|
63
|
myCounter.lastReset.delta, locale='fr', threshold=1)
|
|
64
|
64
|
except Counter.DoesNotExist:
|
|
|
@@ -125,9 +125,9 @@ def home(request):
|
|
125
|
125
|
# cause that after 1 day the « recentness score drops from 1 to 0.36
|
|
126
|
126
|
# The counters with no seum have a like count of -1 by convention
|
|
127
|
127
|
counters = sorted(counters, key=lambda t: - (
|
|
128
|
|
- math.log(t.likeCount + 2) *
|
|
129
|
|
- math.exp(-(t.lastReset.delta.total_seconds()) /
|
|
130
|
|
- (24 * 3600))))
|
|
|
128
|
+ math.log(t.likeCount + 2) /
|
|
|
129
|
+ (1 + (t.lastReset.delta.total_seconds()) /
|
|
|
130
|
+ (24 * 3600))))
|
|
131
|
131
|
|
|
132
|
132
|
# Column graph
|
|
133
|
133
|
if (len(lastResets) == 0):
|