Ho provato facendo una nuova selezione dal Db e quindi creando un nuovo
metodo MySQL.
Ho creato il seguente script "scriptidmultipagina":
# 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.listaId
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
Ho messo "b_size=30" perchè mi diceva che la variabile globale non era
dichiarata. E cliccando su test mi restituisce:
<Products.CMFPlone.PloneBatch.Batch object at 0xe4ee84c>
Quindi ho creato in nuovo template "listaId" con 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="record context/scriptidmultipagina">
</li>
</div>
</body>
</html>
So che non c'è niente dentro il tag <li>, l'ho fatto di proposito solo per
testarla, ma credo di sbagliare qualcosa di elementare che riconosco di non
conoscere ed ignorare.
Dove?
L'errore è il seguente:
...
* Module zope.tales.tales, line 110, in __init__
* Module ZTUtils.Batch, line 88, in __getitem__
AttributeError: __getitem__
--
View this message in context:
http://n2.nabble.com/Plone-Mysql-vista-di-una-semplice-select-tp4772130p4779474.html
Sent from the Plone - Italy mailing list archive at Nabble.com.
_______________________________________________
Plone-IT mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/plone-it
http://www.nabble.com/Plone---Italy-f21728.html