The SDK 1.3.1 Prerelease adds a memcache.grab_tail() function, it's
very useful for counting, but why it only returns values, not a (key,
value) pair list or dict?

If a (key, value) pair list is available to retrieve, I think counting
would be even easier like this:

1) add a page view for article 1:

memcache.incr('1', namespace='article counter', initial_value=0)

2) add a page view for article 2:

memcache.incr('2', namespace='article counter', initial_value=0)

3) use cron jobs to update memcache counter to datastore:

counter = memcache.grab_tail(10, 'article counter')

for article_id, pv in counter:
  # update to datastore


But now, counter only contains pv, no article_id in it, so I can't
find a simple way to implement the same scenario.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to