Skip to content

Commit

Permalink
refactor: Page tidyup
Browse files Browse the repository at this point in the history
  • Loading branch information
danjac committed Dec 29, 2024
1 parent a8187ff commit 6e226d6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions radiofeed/paginator.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __repr__(self) -> str:

def __len__(self) -> int:
"""Returns total number of items"""
return self._num_objects
return len(self.object_list)

def __getitem__(self, index: int | slice) -> ObjectList:
"""Returns indexed item."""
Expand Down Expand Up @@ -88,10 +88,6 @@ def _has_next(self) -> bool:
def _has_previous(self) -> bool:
return self.number > 1

@cached_property
def _num_objects(self) -> int:
return len(self.object_list)

@cached_property
def _next_page_number(self) -> int:
if self.has_next():
Expand Down

0 comments on commit 6e226d6

Please sign in to comment.