[Zope] Z Class troubles...

Kevin Dangoor kid@kendermedia.com
Thu, 19 Aug 1999 11:48:47 -0400


Hi,

    Since count is a property, you'll need to do something like this:

<dtml-call "REQUEST.set('count', count+1)">
<dtml-call "manage_changeProperties(REQUEST)">

You would probably do this in your Count method...

The "problem" with this is that you'll get a new transaction in the database
for every hit. Some people have looked at this problem before (I think there
is a counter product out there for which someone worked on a workaround).

Kevin


-----Original Message-----
From: Donald Holten <donner@biophysics.lanl.gov>
To: zope@zope.org <zope@zope.org>
Date: Thursday, August 19, 1999 11:32 AM
Subject: [Zope] Z Class troubles...


> I have a Z Class with a property count and a function GetCount.  Here's
>GetCount:
> <dtml-call "REQUEST.set('count', Count(REMOTE_ADDR=REMOTE_ADDR,
>                                      count=count,
>                                      excludedIPlist=excludedIPlist))">
> <!--#var count-->
>
> It should increment count by one, since that is what Count does when I
>call it by itself (without the REQUEST.set).  But instead I get count = 0.
> Now, GetCount is a method in a Z Class.  When I call it in the class, I
>get count = 0.  When I call it from an instance, it doesn't print anything.
>Here's how I'm calling it from a DTML page:
> <dtml-with WebSolveAccess>
>    <dtml-call InitCounter>
>    <dtml-call GetCount>
> </dtml-with>
>
> I'd like to be able to print out count's value from this DTML page, but
>I can't.  Is there a way I can print the value of count from the DTML page,
and
>is there a way I can get count to increment like I want it to?  Thanks for
the
>help!
> 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 )
>