[UPDT] BASE: Updated pagination_qry function by replace it into base.methods folder
This commit is contained in:
@@ -9,6 +9,7 @@ from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.contrib.staticfiles import finders
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.core.paginator import Paginator
|
||||
from django.db import models
|
||||
from django.db.models import ForeignKey, ManyToManyField, OneToOneField, Q
|
||||
from django.db.models.functions import Lower
|
||||
@@ -658,6 +659,15 @@ def get_pagination():
|
||||
return count
|
||||
|
||||
|
||||
def paginator_qry(queryset, page_number):
|
||||
"""
|
||||
Common paginator method
|
||||
"""
|
||||
paginator = Paginator(queryset, get_pagination())
|
||||
queryset = paginator.get_page(page_number)
|
||||
return queryset
|
||||
|
||||
|
||||
def is_holiday(date):
|
||||
"""
|
||||
Check if the given date is a holiday.
|
||||
|
||||
Reference in New Issue
Block a user