RE: [Zope] Retrieving a set number of entries
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@cats.ucsc.edu] Sent: Thursday, October 16, 2003 4:37 PM To: zope@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@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 )
participants (1)
-
Jean-Francois.Doyon@CCRS.NRCan.gc.ca