parameters: (request)
return_statement: return render(request, 'fm/rules.html', {'frules': frules,
                                               'page_content': page_content,
                                               'vendor_list': vendor_list})
docstring: FM模块规则页面主页
docstring_summary: FM模块规则页面主页
docstring_tokens: FM模块规则页面主页
function: def frules_index(request):
      """ FM模块规则页面主页 """
      limit = 12  # 每页所显示的规则数量
      rules = FRule.objects.order_by('-add_time').all()
      paginator = Paginator(rules, limit)
      page = request.GET.get('page')
      try:
          frules = paginator.page(page)
      except PageNotAnInteger:
          frules = paginator.page(1)
      except EmptyPage:
          frules = paginator.page(paginator.num_pages)
  
      page_content = pagination(frules)
  
      # vendor list
      vendor_list = Vendor.objects.all()
      return render(request, 'fm/rules.html', {'frules': frules,
                                               'page_content': page_content,
                                               'vendor_list': vendor_list})
function_tokens: def frules_index ( request ) : limit = 12 # 每页所显示的规则数量 rules = FRule . objects . order_by ( '-add_time' ) . all ( ) paginator = Paginator ( rules , limit ) page = request . GET . get ( 'page' ) try : frules = paginator . page ( page ) except PageNotAnInteger : frules = paginator . page ( 1 ) except EmptyPage : frules = paginator . page ( paginator . num_pages ) page_content = pagination ( frules ) # vendor list vendor_list = Vendor . objects . all ( ) return render ( request , 'fm/rules.html' , { 'frules' : frules , 'page_content' : page_content , 'vendor_list' : vendor_list } )