[Zope-dev] New Counter Product

Michel Pelletier michel@digicool.com
Wed, 24 Mar 1999 19:45:49 -0500


> -----Original Message-----
> From: Shaw, Howard [mailto:ShawH@STHS.org]
> Sent: Wednesday, March 24, 1999 7:11 PM
> To: 'Zope-Dev@zope.org'
> Subject: [Zope-dev] New Counter Product
> 
> 
> Well, it is basically finished and working, combining a 
> visible Product
> interface and a counter tag... But, overriding __setstate__, removing
> the temporary entry from the state, and called 
> Persistent.__setstate__,
> while generating no errors, fails to prevent the temporary entry from
> being written into the database.  Please help, I need two answers!
> 
> 1. How can I create a variable within a Product that will not be
> persistent (i.e. will not be written to disk)?
> 
Prefix your variable name with _v_.  If you don't want the attribute foo
to be persistent, call it _v_foo.

> 2. What function is called at normal shutdown? I need to call 
> a function
> at shutdown to move the current value from temp to real.
> 
Uhm.. there isn't a shutdown hook for Products.  Is this what your
looking for?

> Note: The counter is usable as is, so if the list members think that
> Paul's now repudiated fear of constant disk growth is a non-issue, I
> could drop the temporary variable, and just keep the advantages of the
> interface, and the potential for an SQL based backend whilst 
> keeping the
> same front-end.
> 
> Thanks again.
> 
> Howard C. Shaw III
> Programmer/SysAdmin
> St. Thomas High School
> 

-Michel

> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://www.zope.org/mailman/listinfo/zope-dev
> 
> (For non-developer, user-level issues, use the companion list,
> zope@zope.org, http://www.zope.org/mailman/listinfo/zope )
>