libb.paged

paged(order_by_df, per_page_df)[source]

Decorator to pass in default order/page/per page for pagination.

Steps performed:

  1. Acquire the thread-local request object

  2. Calculate pagination order by/offset/limit from request object

  3. Patch the info into a database connection

Parameters:
  • order_by_df (str) – Default column to order by.

  • per_page_df (int) – Default number of items per page.

Returns:

Decorator function.

Warning

Careful not to patch MULTIPLE queries within the controller.