本文整理汇总了Python中sellcard.common.Method.getNextPageNum方法的典型用法代码示例。如果您正苦于以下问题:Python Method.getNextPageNum方法的具体用法?Python Method.getNextPageNum怎么用?Python Method.getNextPageNum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sellcard.common.Method
的用法示例。
在下文中一共展示了Method.getNextPageNum方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: index
# 需要导入模块: from sellcard.common import Method [as 别名]
# 或者: from sellcard.common.Method import getNextPageNum [as 别名]
def index(request):
role_id = request.session.get('s_roleid')
s_shop = request.session.get('s_shopcode')
s_depart = request.session.get('s_depart')
s_user = request.session.get('s_uid')
today = str(datetime.date.today())
start = end = today
actionType = 1
shops = []
users = AdminUser.objects.values('id', 'name','is_enable').filter(role_id__in=('2', '3','5','11'))
if role_id in ('1','6'):
shops = mth.getCityShopsCode()
elif role_id == '9':
shops = mth.getCityShopsCode('T')
elif role_id == '8':
shops = mth.getCityShopsCode('C')
elif role_id in ('2', '10'):
shops = [s_shop]
elif role_id in ('3', '5'):
shopcode = s_shop
depart = s_depart
operator = s_user
personList = users.filter(shop_code__in=shops)
personList = sorted(personList, key=lambda p: p["name"].encode('gb2312'))
departs = base.findDepart()
if request.method == 'POST':
shop,operator,depart = '','',''
if role_id in ('1','6','8','9'):
shop = request.POST.get('shop','')
depart = request.POST.get('depart', '')
operator = request.POST.get('operator', '')
elif role_id in ('2','10') :
shop = s_shop
depart = request.POST.get( 'depart', '')
operator = request.POST.get('operator', '')
elif role_id in ('3','5'):
shop = s_shop
depart = s_depart
operator = s_user
actionType = request.POST.get('actionType','1')
start = request.POST.get('start',today)
end = request.POST.get('end',today)
endTime = datetime.datetime.strptime(end,'%Y-%m-%d') + datetime.timedelta(1)
page = request.POST.get('page',1)
kwargs = {}
if shop:
kwargs.setdefault('shop_code',shop)
if operator:
kwargs.setdefault('operator_id',operator)
if depart:
kwargs.setdefault('depart',depart)
kwargs.setdefault('add_time__gte',start)
kwargs.setdefault('add_time__lte',endTime)
resList, paidTotal, discTotal, cardCount = getData(actionType,kwargs)
paginator = Paginator(resList,20)
try:
resList = paginator.page(page)
page_next = mth.getNextPageNum(resList)
page_prev = mth.getPrevPageNum(resList)
except Exception as e:
print(e)
return render(request, 'report/card/saleGroupByOrder/index.html', locals())