Fakultas Ilmu Komputer UI

Commit a2206d38 authored by Reyhan Alhafizal's avatar Reyhan Alhafizal
Browse files

[REFACTOR] Change seconds_since_project_created method name

parent 1d3c65a2
Pipeline #60139 passed with stages
in 23 minutes and 23 seconds
......@@ -141,8 +141,8 @@ class Materi(SoftDeleteModel):
return Materi.objects.earliest('date_created').date_created.timestamp()
@property
def seconds_since_project_created(self):
return self.date_created.timestamp() - Materi.earliest_materi_timestamp() #1577811600
def seconds_since_earliest_materi(self):
return self.date_created.timestamp() - Materi.earliest_materi_timestamp()
@property
def view_count(self):
......@@ -152,7 +152,7 @@ class Materi(SoftDeleteModel):
@property
def hot_score(self):
view_score = math.log(max(self.view_count, 1), 10)
time_score = self.seconds_since_project_created / 604800 #604800 90000 # 1 minggu
time_score = self.seconds_since_earliest_materi / 604800 # 1 week
return round(view_score + time_score, 7)
@property
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment