Plone und ZSQL

Django, Flask, Bottle, WSGI, CGI…
Antworten
Benutzeravatar
Käptn Haddock
User
Beiträge: 169
Registriert: Freitag 24. März 2006, 14:27

Hallo!
Ich hab die SuFu benutzt aber das gefundene hat mir nicht richtig weiter geholfen, ZSQL-User Guide auch nicht. Das produkt SQLDokument funktioniert nicht aufgrund irgendwelcher fehlender MySQL-Libs. Folgende Situation:
Postgres-Datenbank, darin einige dynamische Daten die in einem Plone-Dokument dargestellt werden sollen. Vorgehen bisher:
Erstellen eines ZSQL-Objekts mit den entsprechenden Daten im gleichen Verzeichnis wie das Dokument auch, funktioniert auch prima. Dann habe ich mit einem Zope Searh Interaface daraus ein Pagetemplate oder dtml-code erzeugt, das funktioniert auch. Allerdings sind bisher alle versuche, das ganze in eine Ploneseite inzubinden gescheitert. es wird immer nur der Rahmen gerendert, im Inhaltsteil steht nichts.

Vieles Dank im Voraus

Uwe

Code des erzeugten Page-template:

Code: Alles auswählen

<html><body>
<html>
  <body tal:define="results  here/noCoords;
                    start request/start|python:0;
                    batch python:modules['ZTUtils'].Batch(results, 
                                                          size=20, 
                                                          start=start);
                    previous python:batch.previous;
                    next python:batch.next">

  <p>
    <a tal:condition="previous"
       tal:attributes="href string:${request/URL0}?start:int=${previous/first}"
       href="previous_url">previous <span tal:replace="previous/length">20</span> results</a>
    <a tal:condition="next"
       tal:attributes="href string:${request/URL0}?start:int=${next/first}"
       href="next_url">next <span tal:replace="next/length">20</span> results</a>
  </p>

  <table border>
        <tr>
          <th>Locid</th>
          <th>Longname</th>
          <th>Station</th>
          <th>Xcoord</th>
          <th>Ycoord</th>
          <th>Zcoordb</th>
        </tr>
       
  <tal:x repeat="result batch" >
  
         <tr>
          <td><span tal:replace="result/locid">locid goes here</span></td>
          <td><span tal:replace="result/longname">longname goes here</span></td>
          <td><span tal:replace="result/station">station goes here</span></td>
          <td><span tal:replace="result/xcoord">xcoord goes here</span></td>
          <td><span tal:replace="result/ycoord">ycoord goes here</span></td>
          <td><span tal:replace="result/zcoordb">zcoordb goes here</span></td>
        </tr>

  </tal:x>

      </table>
  <p>
    <a tal:condition="previous"
       tal:attributes="href string:${request/URL0}?start:int=${previous/first}"
       href="previous_url">previous <span tal:replace="previous/length">20</span> results</a>
    <a tal:condition="next"
       tal:attributes="href string:${request/URL0}?start:int=${next/first}"
       href="next_url">next <span tal:replace="next/length">20</span> results</a>
  </p>

  </body>
</html>

</body></html>
Antworten