[Zope] Retrieving a set number of entries
Jean-Francois.Doyon at CCRS.NRCan.gc.ca
Jean-Francois.Doyon at CCRS.NRCan.gc.ca
Thu Oct 16 16:47:39 EDT 2003
If you're using DTML, then the batch features of DTML are one way to go ...
this however will run the entire query every single time you draw the page
... DTML will then figure out the subset of records to display.
If you want to make sure the SQL query itself only returns things that you
want in a relevant way, then use the LIMIT/OFFSET clause on your SELECT
statement.
Then simply pass form parameters around (Index to start, and how many
records to show), and feed them to the SQL method as necessary, and you're
good to go.
J.F.
-----Original Message-----
From: Lalo Castro [mailto:laloc at cats.ucsc.edu]
Sent: Thursday, October 16, 2003 4:37 PM
To: zope at zope.org
Subject: [Zope] Retrieving a set number of entries
Hi,
I'm building a database interface in Zope. We are using Zope 2.6,
Python
2.1.3, and the database is in PostGreSQL 7.3.3. The problem I am having
is trying to search the database and return a set number of entries.
Like how Yahoo! returns 25 possibilities in it's search per page. Or
how Google returns 10. I'd like to know how to code it so that a
database search returns a set number of entries found, and can make
pages with multiple entries if there's more than the set number of
entries on a page. Anyone have any ideas?
--
Lalo Castro
Programmer/Analyst
McHenry Library
(831) 459-5208
_______________________________________________
Zope maillist - Zope at zope.org
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )
More information about the Zope
mailing list