Package orm2 :: Package ui :: Package xist :: Module result_table :: Class query_params
[hide private]
[frames] | no frames]

Class query_params

source code

This class holds a number of query_param instances. These represent possible url parameter use to control the result_table. It is usually called from within class definitions of result_table's subclasses.

Instance Methods [hide private]
  __getitem__(self, name)
Return a query_param object for param named NAME.
  __init__(self, *params)
Pass query_params as positionsl arguments.
  fill_in_defaults(self, request)
Modify the REQUEST dict and fill in default values where needed.
  generic_sql_clauses(self, request, available_rows=None)
Return a list contining an sql.orderby, sql.offset and an sql.limit object corresponding to REQUEST.
  has_param(self, name)
Indicate whether a param by that NAME exists in the param set.
  href(self, base_url, result_table, request, **kw)
Construct a href with all the right parameters in it.
  validate_all(self, request)
Use the information from the query_param objects to check all the params in request we know about.

Method Details [hide private]

__getitem__(self, name)
(Indexing operator)

source code 
Return a query_param object for param named NAME.

__init__(self, *params)
(Constructor)

source code 
Pass query_params as positionsl arguments.

fill_in_defaults(self, request)

source code 
Modify the REQUEST dict and fill in default values where needed.

generic_sql_clauses(self, request, available_rows=None)

source code 
Return a list contining an sql.orderby, sql.offset and an sql.limit object corresponding to REQUEST. You may specify the AVAILABLE_ROWS parameter to have the method range-check the page param.

has_param(self, name)

source code 
Indicate whether a param by that NAME exists in the param set.

href(self, base_url, result_table, request, **kw)

source code 
Construct a href with all the right parameters in it.
Parameters:
  • base_url - Absolute(?) url of the procedure or external method or whatever calls the result table
  • result_table - The result table object
  • request - Dictionary style object containing the url params of the current request, may be empty.
  • kw - You may pass param/value pairs as key word arguments to change params with regard to the current set passed in 'request' as well as to add new parameters.

validate_all(self, request)

source code 
Use the information from the query_param objects to check all the params in request we know about.
Raises:
  • ValueError - If a param is not set correctly.