[Zope] A TinyTable problem

Ricardo Newbery newbery@dvgroup.com
Wed, 13 Jun 2001 00:08:13 -0700


I'm having some trouble with a TinyTablePlus logging routine.  I have 
a nearly identical setup on another Zope instance but for some reason 
I can't get this one to work.

The TinyTable is in a subtable called 'log' along with a DTML method 
called 'usercnt'

I put the following in the standard_html_header:

   <dtml-let usercnt="_.getattr(log,'usercnt')">
   	<dtml-call usercnt>
   </dtml-let>

The usercnt method does a few different things but I've narrowed the 
problem down to these couple of lines:

   <dtml-unless logtable2>
	<dtml-call expr="REQUEST.set('logtable2','users')">
   </dtml-unless>
   <dtml-with log>
   	<dtml-call 
expr="_.getitem(logtable2).setRow(name=username_forlog,count='1')">
   </dtml-with>

The TinyTable is successfully updated but I always get an error page 
with the following traceback:

<!--
Traceback (innermost last):
   File /usr/local/zope2/lib/python/ZPublisher/Publish.py, line 223, 
in publish_module
   File /usr/local/zope2/lib/python/ZPublisher/Publish.py, line 187, in publish
   File /usr/local/zope2/lib/python/Zope/__init__.py, line 221, in 
zpublisher_exception_hook
     (Object: ApplicationDefaultPermissions)
   File /usr/local/zope2/lib/python/ZPublisher/Publish.py, line 171, in publish
   File /usr/local/zope2/lib/python/ZPublisher/mapply.py, line 160, in mapply
     (Object: index_html)
   File /usr/local/zope2/lib/python/ZPublisher/Publish.py, line 112, 
in call_object
     (Object: index_html)
   File /usr/local/zope2/lib/python/OFS/DTMLMethod.py, line 189, in __call__
     (Object: index_html)
   File /usr/local/zope2/lib/python/DocumentTemplate/DT_String.py, 
line 538, in __call__
     (Object: index_html)
   File /usr/local/zope2/lib/python/OFS/DTMLMethod.py, line 182, in __call__
     (Object: standard_html_header)
   File /usr/local/zope2/lib/python/DocumentTemplate/DT_String.py, 
line 538, in __call__
     (Object: standard_html_header)
   File /usr/local/zope2/lib/python/DocumentTemplate/DT_Let.py, line 
147, in render
     (Object: usercnt=&quot;_.getattr(log,'usercnt')&quot;)
   File /usr/local/zope2/lib/python/OFS/DTMLMethod.py, line 182, in __call__
     (Object: usercnt)
   File /usr/local/zope2/lib/python/DocumentTemplate/DT_String.py, 
line 538, in __call__
     (Object: usercnt)
   File /usr/local/zope2/lib/python/DocumentTemplate/DT_With.py, line 
146, in render
     (Object: log)
   File /usr/local/zope2/lib/python/DocumentTemplate/DT_Util.py, line 
334, in eval
     (Object: _.getitem(logtable2).setRow(name=username_forlog,count='1'))
     (Info: logtable2)
   File &lt;string&gt;, line 0, in ?
   File 
/usr/local/etc/httpd/zope2/Products/TinyTablePlus/TinyTablePlus.py, 
line 654, in setRow
     (Object: log_users)
   File 
/usr/local/etc/httpd/zope2/Products/TinyTablePlus/TinyTablePlus.py, 
line 511, in _GenerateIndex
     (Object: log_users)
   File /usr/local/zope2/lib/python/ZODB/PersistentMapping.py, line 
119, in __setitem__
AttributeError: __hash__

-->

So, any ideas what's wrong?

Ricardo Newbery
newbery@dvgroup.com