Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

pypm install ks.pager

How to install ks.pager

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install ks.pager
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.0.1 Available View build log
Windows (64-bit)
1.0.1 Available View build log
Mac OS X (10.5+)
1.0.1 Available View build log
Linux (32-bit)
1.0.1 Available View build log
Linux (64-bit)
1.0.1 Available View build log
ZPL 2.1
Lastest release
version 1.0.1 on Jan 5th, 2011

ks.pager package is a collection of adapters for paged listings of objects.

This product is part of Hivurt Changes for ks.pager ==========================

1.0.1 (first release)

System Message: WARNING/2 (<string>, line 11)

Title underline too short.

1.0.1 (first release)
  • Initial code commit

System Message: WARNING/2 (<string>, line 14)

Bullet list ends without a blank line; unexpected unindent.
Detailed Documentation

Description of ks.pager :

Author -- Anatoly Bubenkov

Version -- $Id: README.txt 23735 2007-11-08 18:22:32Z anatoly $

URL -- $URL: https://code.keysolutions.ru/svn/ks.pager/trunk/src/ks/pager/README.txt $


Product ks.pager allows view creation with paged listing of elements(objects).

Realization idea:

Product consists of such parts:

  • Base view adapter pager, it's a adapter factory for iterable object.

System Message: WARNING/2 (<string>, line 34)

Bullet list ends without a blank line; unexpected unindent.

Adapter factory provides IPagerFactory interface:

  • init(iterable) -- get adapter to IPager;
  • Base adapter of iterable object and request zope.publisher.interfaces.http.IHTTPRequest

System Message: WARNING/2 (<string>, line 39)

Bullet list ends without a blank line; unexpected unindent.

to IPagerParams pager parameters interface:

  • start -- start element of chunk;
  • chunkSize -- size of chunk;
  • chunkCount -- chunk link count on one page;

This adapter called by adapter factory IPagerFactory.

  • Base adapter of iterable object to paged source interface IPagedSource:
  • getCount() -- count of all elements in object;
  • getChunk(start, chunkSize) -- get chunk with size chunkSize and start with start;

This adapter called by adapter factory IPagerFactory. Abstraction is needed for cases, when element source supports paged output (sql, for example).

  • Base adapter of paged source IPagedSource,

System Message: WARNING/2 (<string>, line 59)

Bullet list ends without a blank line; unexpected unindent.

pager params IPagerParams and request zope.publisher.interfaces.http.IHTTPRequest to IPager:

  • nextChunkUrl() -- link to next chunk;
  • prevChunkUrl() -- link to previous chunk;
  • haveNextChunk() -- flag "have next chunk";
  • havePrevChunk() -- flag "have previous chunk";
  • chunkUrlList() -- chunk url list (tuple (page number, link));
  • сhunk() -- element chunk;
  • сount() -- full element count;
  • lastChunkUrl() -- link to last chunk;
  • firstChunkUrl() -- link to first chunk;
  • onFirstChunk() -- flag "on first chunk";
  • onLastChunk() -- flag "on last chunk";

This adapter called by adapter factory IPagerFactory.

  • Base macros listing for comfort using of pager.

Example of using in page template:

<tal:block tal:define="pager context/@@pager;

System Message: ERROR/3 (<string>, line 91)

Inconsistent literal block quoting.

chunk python:pager.init([1,2,3,4,5,6,7,8,9])">

<ul tal:repeat="item python:chunk.chunk"> <li tal:content="item"/> </ul>

<div tal:content="string:Element Count: ${chunk/count}, Page Count: ${chunk/chunkCount}" />

<tal:block condition="python:chunk.chunkCount > 1"> <br/>

<a href="" tal:attributes="href chunk/firstChunkUrl" tal:condition="not:chunk/onFirstChunk"> first </a>

<a href="" tal:attributes="href chunk/prevChunkUrl" tal:condition="chunk/havePrevChunk"> prev </a>

<tal:block repeat="item python:chunk.chunkUrlList"> <a href="" tal:define="itemstyle python:item.selected and 'red' or 'black'" tal:attributes="href item/url; style string:color:${itemstyle};" tal:content="item/title"> 1 </a> </tal:block>

<a href="" tal:attributes="href chunk/nextChunkUrl" tal:condition="chunk/haveNextChunk"> next </a>

<a href="" tal:attributes="href chunk/lastChunkUrl" tal:condition="not:chunk/onLastChunk"> last </a> </tal:block> </tal:block>

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.