Skip to content

Commit 7bf7c4c

Browse files
committed
move property above class method
1 parent 1833698 commit 7bf7c4c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

openlibrary/core/yearly_reading_goals.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ class ReadingGoal:
1414
target: int
1515
books_read: int = 0
1616

17+
@property
18+
def progress(self) -> int:
19+
return floor((self.books_read / self.target) * 100) if self.target > 0 else 0
20+
1721
@classmethod
1822
def from_row(cls, row: dict) -> 'ReadingGoal':
1923
return cls(
@@ -22,10 +26,6 @@ def from_row(cls, row: dict) -> 'ReadingGoal':
2226
target=row['target'],
2327
)
2428

25-
@property
26-
def progress(self) -> int:
27-
return floor((self.books_read / self.target) * 100) if self.target > 0 else 0
28-
2929

3030
class YearlyReadingGoals:
3131
TABLENAME = 'yearly_reading_goals'

0 commit comments

Comments
 (0)