[Zope-DB] result set question

Christian Theune ct@gocept.com
Wed, 13 Mar 2002 08:20:29 +0100

Hi Alexander.

* Alexander Batzios <alexb@runbox.com> [020313 07:00]:
> Hello.
> I am developing a search engine with Zope. It queries a mySQL database
> according to the search criteria of a web form and outputs the results. I
> have it working and all but I would like to ask two things:
> 1. Is it possible to split the results into pages of say 10 results? If yes,
> how? Does Zope provide a way of doing this? Do I need to ask mySQL to fetch
> the first 10 records, then the next 10, and so on? Is it possible?  
Yes it is. See the dtml-in options in the dtml reference for "batching" to
do so. (Zope Online Help in your ZMI -> Zope Help -> DTML Reference)
> 2. I want to have each record hyperlinked, so that when a user clicks on it,
> he/she can view more details. Do I need to create a separate database access
> object to handle these requests?

Do you mean "Database connections"? Then the answer is "no". If you think to create a
second query (Z SQL Method): for sure. If you need deeper help on the "database access
object" try to post your questions using more well known terms.

> I am sorry if these are too simple questions, but I am reading the
> documentation and cannot find an exact answer. I am still trying to grasp
> exactly how zope works.
> Thanks, Alex

No problem, but try using the Online Help of the ZMI more often, you will find
a lot of useful informationen e.g. about DTML there.



Christian Theune - ct@gocept.com
gocept gmbh & co.kg - schalaunische strasse 6 - 06366 koethen/anhalt
tel.+49 3496 3099112 - fax.+49 3496 3099118 mob. - 0178 48 33 981

reduce(lambda x,y:x+y,[chr(ord(x)^42) for x in 'zS^BED\nX_FOY\x0b'])