[Zope] Returning database results similar to google search

Dylan Reinhardt zope at dylanreinhardt.com
Fri Dec 5 16:24:32 EST 2003


On Fri, 2003-12-05 at 13:08, Dylan Reinhardt wrote:

> ----
> records = context.your_zsql_method(args)
> batch_size = 5
> 
> last_record = min([offset+batch_size,len(records)])
> 
> for record_num in range(offset, last_record):
>     print records[record_num]['some_info']
> for page in range(0,len(results),batch_size):

should be records---------^^^^^^^

>     print '<a href=your_url?offset=%s>%s</a>' % (page,page/batch_size)
> return printed
> -----






More information about the Zope mailing list