Package turbogears :: Module paginate'

Module paginate'

source code

Classes
  Paginate
class for variable provider
Functions
 
convert_ordering(ordering)
Covert ordering unicode string to dict.
source code
 
paginate(var_name, default_order='', default_reversed=None, limit=10, allow_limit_override=False, max_pages=5, dynamic_limit=None) source code
 
sort_ordering(ordering, sort_name)
Rearrange ordering based on sort_name.
source code
 
sql_get_column(colname, var_data)
Return a column from var_data based on colname.
source code
 
sql_order_col(col, ascending=True)
Return an ordered col for col.
source code
Variables
  SASelectResults = None
  log = <logging.Logger instance at 0x8d3e82c>
  ordering_expr = re.compile(r'(\'\w+(\.\w+)*\'): ?\[(\d+), ?(Tr...
  variable_providers = []
Function Details

paginate(var_name, default_order='', default_reversed=None, limit=10, allow_limit_override=False, max_pages=5, dynamic_limit=None)

source code 
Parameters:
  • var_name (string) - the variable name that the paginate decorator will try to control. This key must be present in the dictionnary returned from your controller in order for the paginate decorator to be able to handle it.
  • default_order (string or a list of strings. Any string starting with "-" (dash) indicates a reverse order for that field/column.) - Needs work! XXX
  • default_reversed (Boolean [Deprecated]) - Needs work! XXX
  • limit (integer) - the hard coded limit that the paginate decorator will impose on the number of "var_name" to display at the same time. This value can be overridden by the use of the dynamic_limit keyword argument
  • allow_limit_override (Boolean) - A boolean that indicates if the parameters passed in the calling URL can modify the imposed limit. By default it is set to False. If you want to be able to control the limit by using an URL parameter then you need to set this to True.
  • max_pages (integer) - Needs work! XXX
  • dynamic_limit (string) - If specified, this parameter must be the name of a key present in the dictionnary returned by your decorated controller. The value found for this key will be used as the limit for our pagination and will override the other settings, the hard-coded one declared in the decorator itself AND the URL parameter one. This enables the programmer to store a limit settings inside the application preferences and then let the user manage it.

Variables Details

ordering_expr

Value:
re.compile(r'(\'\w+(\.\w+)*\'): ?\[(\d+), ?(True|False)\]')