Cours/venv/lib/python3.12/site-packages/paginate/ext_reverse.py

15 lines
413 B
Python
Raw Normal View History

2024-09-02 16:55:06 +00:00
"""Test class to just return reverse elements in a range"""
import paginate
class ReversePage(paginate.Page):
# def __init__(self, *args, **kwargs):
# super(ReversePage, self).__init__(*args, **kwargs)
def __getitem__(self, key):
# if isinstance(key, slice):
# return list(reversed(self.collection))[key]
# else:
return list(reversed(self.collection))[key]