[Zope] Unchanging Z Class Instance

Alexander Staubo alex@mop.no
Fri, 20 Aug 1999 21:01:46 +0200


Your "count = count + 1" line doesn't update the instance. You should be
assigning "self.count" instead.

Note that each count will incur one transaction in the Zope ODB, because
you are storing the count in your class instance.

-- 
Alexander Staubo             http://www.mop.no/~alex/
"QED?" said Russell.
"It's Latin," said Morgan. "It means, 'So there you bastard'."
--Robert Rankin, _Nostramadus Ate My Hamster_

> -----Original Message-----
> From: Donald Holten [mailto:donner@biophysics.lanl.gov]
> Sent: 20. august 1999 20:13
> To: zope@zope.org
> Subject: [Zope] Unchanging Z Class Instance
> 
> 
> 	I have a Z Class instance that I am accessing by:
> 	<!--#var standard_html_header-->
>         <dtml-with WebSolveAccess>
> 	  <dtml-call "Count(this(), REMOTE_ADDR, count, excludedIPlist, 
> REQUEST)">
> 	  <!--#var "REQUEST['count']"-->
> 	  </dtml-with>
> 	<!--#var standard_html_footer-->
> 	
> 	The Count routine is:
> 	def Count(self, REMOTE_ADDR, count, excludedIPlist, REQUEST):
> 	  if CheckAddress(excludedIPlist, REMOTE_ADDR) == 0:
> 	    count = count + 1
> 	    REQUEST=REQUEST.set('count', count)
> 	    
> self.propertysheets.Properties.manage_changeProperties(REQUEST)
> 	  return
> 
> 	The variable count is not being updated in the Z Class Instance 
> WebSolveAccess.  Is it because of mis-done syntax?   I 
> haven't found anything on 
> the documents on accessing your Z Class once you've created 
> it.  Can anyone 
> direct me where to look for this information or tell me what 
> I'm doing wrong?  
> Thanks!
> 	Donner
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (To receive general Zope announcements, see:
> http://www.zope.org/mailman/listinfo/zope-announce
> 
> For developer-specific issues, zope-dev@zope.org -
> http://www.zope.org/mailman/listinfo/zope-dev )
>