[Zope] How to get batch size variable in ZPT

Dieter Maurer dieter@handshake.de
Thu, 27 Jun 2002 19:58:44 +0200


bding writes:
 > I have tried the following, but it always give me an error:
 > exceptions.TypeError on unsupported operand types for + in ""
 > 
 > "ssize" is a variable in the form.
 > Can anybody give me an explanation?
 > 
 > ========== code code code =================
 > <body tal:define="results python:here.objectValues('File');
 >     start request/start | python:0;
 >     batch_size request/ssize | python:5;
 >     batch python:modules['ZTUtils'].Batch(results, size=batch_size,
 > start=start, orphan=0);
 >     previous python:batch.previous;
 >     next python:batch.next">
Probably "ssize" is a string and Python refuses to add an integer
to a string.

Add:

	batch_size python:int(batch_size);

after the (first) definition of "batch_size".


Dieter