tag:blogger.com,1999:blog-4863385321719829189.post8790458734771394716..comments2010-02-04T02:00:30.660-08:00Comments on All buttons pressed: Sharding with Django on App EngineUnknownnoreply@blogger.comBlogger2125tag:blogger.com,1999:blog-4863385321719829189.post-29095771157701181522010-01-21T00:25:53.489-08:002010-01-21T00:25:53.489-08:00Thanks for your idea, this is a nice improvement.
...Thanks for your idea, this is a nice improvement.<br />You are right, with the current port it's not possible to decrement the counter. But i just wanted to port Joe Gregorio's code :)<br />There exists a simpler method of decrementing such a counter without having to maintain two different properties. You can take a look at this here:<br />http://bitbucket.org/gumptioncom/gaegene/src/tip/counter/models.py<br /><br />Bye,<br />ThomasThomas Wanschikhttps://www.blogger.com/profile/11094753817235500323noreply@blogger.comtag:blogger.com,1999:blog-4863385321719829189.post-86972829130145281162010-01-20T20:58:06.416-08:002010-01-20T20:58:06.416-08:00I wrote a version of the CounterShardConfig that s...I wrote a version of the CounterShardConfig that support decrements correctly. <br /><br />The original Sharded counter article uses memcache.incr(name) but name can't be negative. The trick is to maintain a counter.offset property.<br /><br /> total += counter.count<br /> total -= counter.offsetKugutsumenhttps://www.blogger.com/profile/01299135613859748333noreply@blogger.com