ned"> Kwesties 0 Pull-aanvragen 0 Commits 365 Publicaties 0

拍爱

page_utils.py 590B

    # -*- coding: utf-8 -*- from django.db.models.query import QuerySet def pagination(queryset, page, num=10, strict=False): """ Simple Pagination Funciton :param queryset: :param page: :param num: number per page :param strict: strict left number or not :return: matched query, left number(default not strict) """ start, end = num * (page - 1), num * page return queryset[start: end], max(queryset.count() if isinstance(queryset, QuerySet) else len(queryset) - end, 0) if strict else len(queryset[end: end + 1])
kodo - Gogs: Go Git Service

Nessuna descrizione

Brightcells: 5301e7237e unify join group logic 10 anni fa
..
migrations 8b7c49ddb9 add app to add page user_agreement/contact_us 10 anni fa
templates 5301e7237e unify join group logic 10 anni fa
__init__.py 8b7c49ddb9 add app to add page user_agreement/contact_us 10 anni fa
admin.py 8b7c49ddb9 add app to add page user_agreement/contact_us 10 anni fa
models.py 8b7c49ddb9 add app to add page user_agreement/contact_us 10 anni fa
tests.py 8b7c49ddb9 add app to add page user_agreement/contact_us 10 anni fa
views.py 8b7c49ddb9 add app to add page user_agreement/contact_us 10 anni fa