@core_helper
def get_page_number(params, key='page', default=1):
 p = params.get(key, default)
 try:
  p = int(p)
  if (p < 1):
   raise ValueError('Negative number not allowed')
 except ValueError:
  import ckan.lib.base as base
  base.abort(400, '"{key}" parameter must be a positive integer'.format(key=key))
 return p

@ core_helper def get_page_number ( params , key = 'page' , default = 1 ) : p = params . get ( key , default ) try : p = int ( p ) if ( p < 1 ) : raise ValueError ( 'Negative number not allowed' ) except ValueError : import ckan . lib . base as base base . abort ( 400 , '"{key}" parameter must be a positive integer' . format ( key = key ) ) return p
return the page number from the provided params after verifying that it is an positive integer .