[Zope-dev] ZPattens Question? Guestbook example
James Johnson
jimbo@tacoma.zzn.com
Sun, 3 Sep 2000 13:25:28 -0700
<html><head><meta Name='keywords' Content='commtouch, pronto, mail, free email, free, branded, web based, free web based email, communications, internet, software, advertising banners, e-mail, free software'></head><body ><div align='left'><font ><blockquote><blockquote><TT><BR>
Hello,<BR>
I'm trying to get the basic app building concept down with ZPatterns. <BR>
Forgive me if I'm way off the mark. I'm building off the guest book <BR>
example from the new Zope book. What I've done is created a product <BR>
folder call Gbook. Inside I've created a dtml method index_html, a <BR>
specialist named Guestbook and a Dataskin instance called <BR>
Guestbook_entry. I have one property sheet named GBookProps defined <BR>
for dataskin ZClass. Instead of storing the guestbook entries in <BR>
documents I'm trying to store them using the dataskin database.<BR>
<BR>
In the Specialist(Guestbook) I have 3 methods addEntry, <BR>
addEntryAction, and addEntryForm<BR>
When I call addEntry I get. <BR>
TypeError<BR>
sequence-index must be an integer<BR>
I thought I was so close to understanding me not understanding. :)<BR>
It seems to me that the "only" way to produce a ZPatterns based <BR>
product is to do it from python. <BR>
How about this, should I be trying to add entries this way? <BR>
"""dtml method addEntry"""<BR>
<dtml-var standard_html_header><BR>
<center><BR>
<h2> Inserting new Guest Book Table Info Item!</h2><BR>
<dtml-let id="'entry_%d' % len(self.objectIds())"><BR>
ni="newItem(Guestbook)"><BR>
</dtml-let><BR>
<dtml-call "ni.propertysheets.manage_addPropertySheet<BR>
(id='GBookProps', ns='')"><BR>
<dtml-let nips="ni.propertysheets.get('GBookProps')"><BR>
<dtml-call "nips.manage_addProperty('guest_name', guest_name, <BR>
'string')"><BR>
<dtml-call "nips.manage_changeProperties(REQUEST)"><BR>
<BR>
</dtml-let><BR>
<form action=index_html><BR>
<input type=submit value="OK"><BR>
</form><BR>
</center><BR>
Thanks,<BR>
Jimbo<BR>
</TT><br><br><font><p align=left><TT>Hitz N Bitz member<BR>
http://www.tacomaplace.com<BR>
http://bbs.tacomaplace.com </TT><br>Get your Free E-mail at http://tacoma.zzn.com<br>____________________________________________________________<br>Get your own Web-Based E-mail Service at http://www.zzn.com<br></blockquote></blockquote></div></font></body></html>