def get_current_page(request, objs, obj, amount):
    """Returns the current page of obj within objs.
    """
    try:
        page = int((request.POST if request.method == 'POST' else request.GET).get("page"))
    except TypeError:
        try:
            idx = tuple(objs).index(obj)
        except __HOLE__:
            page = 1
        else:
            page = int(idx / amount) + 1

    return page
dataset/ETHPy150Open diefenbach/django-lfs/lfs/manage/utils.py/get_current_page