[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. &nbsp;I'm building off the guest book <BR>
example from the new Zope book. &nbsp;What I've done is created a product <BR>
folder call Gbook. &nbsp;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. &nbsp;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 &quot;only&quot; 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? &nbsp;<BR>
 &quot;&quot;&quot;dtml method addEntry&quot;&quot;&quot;<BR>
&lt;dtml-var standard_html_header&gt;<BR>
&lt;center&gt;<BR>
&lt;h2&gt; Inserting new Guest Book Table Info Item!&lt;/h2&gt;<BR>
&lt;dtml-let id=&quot;'entry_%d' % len(self.objectIds())&quot;&gt;<BR>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ni=&quot;newItem(Guestbook)&quot;&gt;<BR>
&lt;/dtml-let&gt;<BR>
 &nbsp; &nbsp;&lt;dtml-call &quot;ni.propertysheets.manage_addPropertySheet<BR>
(id='GBookProps', ns='')&quot;&gt;<BR>
&lt;dtml-let nips=&quot;ni.propertysheets.get('GBookProps')&quot;&gt;<BR>
 &nbsp; &nbsp;&lt;dtml-call &quot;nips.manage_addProperty('guest_name', guest_name, <BR>
'string')&quot;&gt;<BR>
 &nbsp; &nbsp;&lt;dtml-call &quot;nips.manage_changeProperties(REQUEST)&quot;&gt;<BR>
<BR>
&lt;/dtml-let&gt;<BR>
&lt;form action=index_html&gt;<BR>
&lt;input type=submit value=&quot;OK&quot;&gt;<BR>
&lt;/form&gt;<BR>
&lt;/center&gt;<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>