[Zope] increment value of self

Tino Wildenhain tino@wildenhain.de
Wed, 11 Dec 2002 23:48:29 +0100


Hi Davis,

--On Mittwoch, 11. Dezember 2002 14:20 -0800 Davis Marques 
<davis@mccalldesign.com> wrote:

>
>
> I'm having a lot of problems with this one ... I have an object (A) that
> has a method called increment, and a variable in the Basic propertysheet
> called count.  I'd like other objects to be able to call that method, so
> that the A object increments the value of count + 1 when requested.
>
>
>
> The problem I'm having is that any other variables present in REQUEST are
> then also assigned to A.
>
>
>
> Here's what I have so far:
>
>
>
> """
>
> increment
>
> """
>
>
>
> c = context.count + 1
>
> context.REQUEST.set('count',c)
>
> context.propertysheets.Basic.manage_editProperties(context.REQUEST)
>
>


contest.propertysheets.Basic.manage_editProperties({'count':context.count+1
})



Btw. You should not even think of using this construct as a hit-counter
as, beside such counters suck anyway, you will bloat out your Data.fs :-)
(Every single change gets stored)

Regards
Tino