[Plone-IT] Re: Plone - Mysql - vista di una semplice select

TommyN selfesteem84 a yahoo.it
Gio 25 Mar 2010 22:37:18 UTC


Ti ringrazio prima di tutto per le info che mi dai. Smanettando a destra e
sinistra comincio a capire il codice, sempre di più.
Adesso lo script python è il seguente:
# Import a standard function, and get the HTML request and response objects.
from Products.PythonScripts.standard import html_quote
request = container.REQUEST
RESPONSE =  request.RESPONSE
contents = context.selectId()
b_size = 30
from Products.CMFPlone import Batch
b_start = context.REQUEST.get('b_start', 0)
batch = Batch(contents, b_size, int(b_start), orphan=0)
return batch
sembra ok, poichè in test mi restituisce questo:
<Products.CMFPlone.PloneBatch.Batch object at 0xcc5bdec>
mentre ZPT ha il seguente codice:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
      lang="en"
      metal:use-macro="here/main_template/macros/master"
      i18n:domain="plone">
<body>
<div metal:use-macro="here/batch_macros/macros/navigation" />
<div metal:fill-slot="main">

    <h1>Lista Id</h1>
        <li tal:repeat="risultato python:context.scriptidmultipagina">
            ID
        </li>
</div>
</body>
</html>
ma mi restituisce il seguente codice
Exception Type  	TypeError
Exception Value 	iteration over non-sequence
Questo vuol dire che l'oggetto restituito dallo script non è iterabile?
-- 
View this message in context: http://n2.nabble.com/Plone-Mysql-vista-di-una-semplice-select-tp4772130p4800748.html
Sent from the Plone - Italy mailing list archive at Nabble.com.




Maggiori informazioni sulla lista Plone-IT