I'd like to implement a simple counter in zope (I'm surprised I couldnt find one already actually).. So I imagine something like this is pretty simple, but I have no idea where to start..
My first thought was just to create a new variable, and have the DHTML write to it, but it doesn't seem like that's possible.
How do I create new values in the zope db, access them and assign things to them?
you may want to search the archive. i have this snipped from a post last week (apologies to original author - can't find sender/post) - [snip]
This should do it: <dtml-call "propertysheets.YourPropSheet.manage_changeProperties({'count' : count+1})">
Keeping in mind of course that you still have that ages old "this creates a transaction each time the method is hit" issue that's come up with the previous counter products... [/snip]
btw, if anyone can enlighten me on this "creates a transaction each time the method is hit" issue, i'd appreciate it - i couldn't find any thread on it and related problems. --------------------------------------------------------------------------- wait, found something else in the archives - [snip from Alexander Staubo] Guest Counter is a very simple product whose class instances can count the number of "guests" to a web site. It counts users using any kind of ID you want, although it makes most sense to use a user's IP address. Since HTTP is a stateless protocol, visitors cannot be precisely tracked, and so the counter continually times out registered IDs in order to approximate the current bulk of visitors. A simple mechanism for piecing together "graphical" counters using GIFs or whatever you want is also provided. Installation instructions: Unzip/tar in Zope root folder, then restart Zope. The new meta type "Guest Counter" should be now available for adding to folders. (I made a small blooper that meant that each count incurred a transaction in the Zope OFS. This has been fixed.) http://www.mop.no/~alex/download/guestcounter-1.1.tar.gz [/snip] can't vouch for any of this but there you have it. chas